Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os.sysconf(): return type of the C function sysconf() is long, not int #62164

Closed
vstinner opened this issue May 12, 2013 · 4 comments
Closed

Comments

@vstinner
Copy link
Member

BPO 17964
Nosy @vstinner, @benjaminp
Files
  • sysconf_long.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2013-05-16.20:28:42.133>
    created_at = <Date 2013-05-12.23:58:36.795>
    labels = []
    title = 'os.sysconf(): return type of the C function sysconf() is long, not int'
    updated_at = <Date 2013-05-16.20:28:42.132>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2013-05-16.20:28:42.132>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-05-16.20:28:42.133>
    closer = 'vstinner'
    components = []
    creation = <Date 2013-05-12.23:58:36.795>
    creator = 'vstinner'
    dependencies = []
    files = ['30242']
    hgrepos = []
    issue_num = 17964
    keywords = ['patch']
    message_count = 4.0
    messages = ['189078', '189080', '189404', '189406']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'benjamin.peterson', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue17964'
    versions = ['Python 2.7', 'Python 3.3', 'Python 3.4']

    @vstinner
    Copy link
    Member Author

    According to POSIX and my manual page on Linux, sysconf() return type is long (and not int).
    http://pubs.opengroup.org/onlinepubs/009695399/functions/sysconf.html

    It may not mater in practice because most sysconf() results are smaller than 1000, and I failed to find a value bigger than 2 millions.

    @benjaminp
    Copy link
    Contributor

    That looks reasonable to me.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 16, 2013

    New changeset 7c60cf756097 by Victor Stinner in branch 'default':
    Issue bpo-17964: Fix os.sysconf(): the return type of the C sysconf() function
    http://hg.python.org/cpython/rev/7c60cf756097

    @vstinner
    Copy link
    Member Author

    The bug does also exist in Python 2.7, 3.2 and 3.3, but I prefer to not fix it in these versions because I'm not 100% sure that the return type is long on all platforms and because nobody noticed the issue since years. So if I broke something, I prefer to only break the development branch ;-)

    I applied the fix to Python 3.4 and so I'm closing the issue.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants