Skip to content

O_ASYNC and FASYNC should be defined if available #47139

Closed

Description

@donmez
mannequin
BPO 2890
Nosy @birkenfeld, @amauryfa
Files
  • async.patch: Add O_ASYNC and FASYNC as GNU extensions
  • async-doc.patch: Add documentation for O_ASYNC
  • 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 2008-05-16.13:10:34.714>
    created_at = <Date 2008-05-16.07:25:03.016>
    labels = ['type-feature', 'library']
    title = 'O_ASYNC and FASYNC should be defined if available'
    updated_at = <Date 2008-05-16.13:42:02.644>
    user = 'https://bugs.python.org/donmez'

    bugs.python.org fields:

    activity = <Date 2008-05-16.13:42:02.644>
    actor = 'georg.brandl'
    assignee = 'none'
    closed = True
    closed_date = <Date 2008-05-16.13:10:34.714>
    closer = 'georg.brandl'
    components = ['Library (Lib)']
    creation = <Date 2008-05-16.07:25:03.016>
    creator = 'donmez'
    dependencies = []
    files = ['10342', '10344']
    hgrepos = []
    issue_num = 2890
    keywords = ['patch']
    message_count = 12.0
    messages = ['66921', '66922', '66923', '66924', '66925', '66931', '66932', '66937', '66938', '66939', '66942', '66945']
    nosy_count = 4.0
    nosy_names = ['georg.brandl', 'amaury.forgeotdarc', 'donmez', 'mishok13']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue2890'
    versions = ['Python 2.5']

    Activity

    1. donmez commented on May 16, 2008

      donmezmannequin
      MannequinAuthor

      os module have varios O_ declerations but it doesn't define O_ASYNC.
      Same for fcntl module which doesn't define FASYNC.

      Simply defining

      O_ASYNC = 020000

      works fine but its not as elegant as saying os.O_ASYNC.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-featureA feature request or enhancement
      on May 16, 2008
    3. mishok13 commented on May 16, 2008

      mishok13mannequin
      Mannequin

      These flags are non-posix, linux-specific constants. Python 'os' module
      uses 'posix' module for all *nix systems, including those, that do not
      support O_ASYNC and FASYNC flags. I think your feature request should be
      rejected.

    4. donmez commented on May 16, 2008

      donmezmannequin
      MannequinAuthor

      I think they at least should be supported on Linux then. It does work if
      you use the value itself anyway.

    5. mishok13 commented on May 16, 2008

      mishok13mannequin
      Mannequin

      I think they at least should be supported on Linux then.

      And what happens if some Unix flavor (i.e. Solaris) adds new flag, say
      O_NONLINUXSYNC and it has the same value as linux's O_ASYNC? And then
      FreeBSD adds O_BSDSYNC flag with the same number and so on. Then Python
      will have to have separate system-specific module for each *nix system
      that uses Python. Why do you think Python maintainers would want that?

      It does work if you use the value itself anyway.

      It's the way fcntl works -- it's just a thin layer on top of fcntl() and
      ioctl() calls. But that's not a good reason for including non-posix
      flags to 'posix' module

    6. amauryfa commented on May 16, 2008

      @amauryfa
      Contributor

      Platform-specific values are not a problem.
      On win32 os.O_NOINHERIT == 128, and on linux os.O_EXCL has the same value.

      Python just exposes the available #defines at the module level.
      (btw, the posix module is also available on windows. It is named 'nt',
      but it is really the same module)

      And in posixmodule.c, There are already some "GNU extensions":
      os.O_DIRECT, os.O_NOFOLLOW...

    7. donmez commented on May 16, 2008

      donmezmannequin
      MannequinAuthor

      Add O_ASYNC and FASYNC as GNU extensions.

    8. donmez commented on May 16, 2008

      donmezmannequin
      MannequinAuthor

      Python code already has GNU/Windows only exceptions. Attached patch adds
      O_ASYNC and FASYNC as GNU extensions. If accepted I can send a
      complimentary documentation patch.

    9. changed the title [-]O_ASYNC and FASYNC should be defined for *nix systems[/-] [+]O_ASYNC and FASYNC should be defined if available[/+] on May 16, 2008
    10. birkenfeld commented on May 16, 2008

      @birkenfeld
      Member

      OK, committed patch in r63368. Thanks!

    11. donmez commented on May 16, 2008

      donmezmannequin
      MannequinAuthor

      Thanks, can you also apply to py3k branch? :)

    12. birkenfeld commented on May 16, 2008

      @birkenfeld
      Member

      That will happen automatically.

    13. donmez commented on May 16, 2008

      donmezmannequin
      MannequinAuthor

      Documentation patch is added too.

    14. birkenfeld commented on May 16, 2008

      @birkenfeld
      Member

      Thanks, applied in r63373.

    15. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions