Issue 2890: O_ASYNC and FASYNC should be defined if available (original) (raw)

Created on 2008-05-16 07:25 by donmez, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
async.patch donmez,2008-05-16 11:36 Add O_ASYNC and FASYNC as GNU extensions
async-doc.patch donmez,2008-05-16 13:30 Add documentation for O_ASYNC
Messages (12)
msg66921 - (view) Author: Ismail Donmez (donmez) * Date: 2008-05-16 07:25
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.
msg66922 - (view) Author: Andrii V. Mishkovskyi (mishok13) Date: 2008-05-16 08:16
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.
msg66923 - (view) Author: Ismail Donmez (donmez) * Date: 2008-05-16 08:31
I think they at least should be supported on Linux then. It does work if you use the value itself anyway.
msg66924 - (view) Author: Andrii V. Mishkovskyi (mishok13) Date: 2008-05-16 08:55
>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
msg66925 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-05-16 09:25
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...
msg66931 - (view) Author: Ismail Donmez (donmez) * Date: 2008-05-16 11:33
Add O_ASYNC and FASYNC as GNU extensions.
msg66932 - (view) Author: Ismail Donmez (donmez) * Date: 2008-05-16 11:35
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.
msg66937 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-05-16 13:10
OK, committed patch in r63368. Thanks!
msg66938 - (view) Author: Ismail Donmez (donmez) * Date: 2008-05-16 13:12
Thanks, can you also apply to py3k branch? :)
msg66939 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-05-16 13:15
That will happen automatically.
msg66942 - (view) Author: Ismail Donmez (donmez) * Date: 2008-05-16 13:30
Documentation patch is added too.
msg66945 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-05-16 13:42
Thanks, applied in r63373.
History
Date User Action Args
2022-04-11 14:56:34 admin set github: 47139
2008-05-16 13:42:02 georg.brandl set messages: +
2008-05-16 13:30:18 donmez set files: + async-doc.patchmessages: +
2008-05-16 13:15:07 georg.brandl set messages: +
2008-05-16 13:12:54 donmez set messages: +
2008-05-16 13:10:34 georg.brandl set status: open -> closedresolution: acceptedmessages: + nosy: + georg.brandl
2008-05-16 11:40:28 donmez set title: O_ASYNC and FASYNC should be defined for *nix systems -> O_ASYNC and FASYNC should be defined if available
2008-05-16 11:36:49 donmez set files: - async.patch
2008-05-16 11:36:23 donmez set files: + async.patchmessages: +
2008-05-16 11:34:37 donmez set files: + async.patchkeywords: + patchmessages: +
2008-05-16 09:25:30 amaury.forgeotdarc set nosy: + amaury.forgeotdarcmessages: +
2008-05-16 08:55:28 mishok13 set messages: +
2008-05-16 08:31:32 donmez set messages: +
2008-05-16 08:16:22 mishok13 set nosy: + mishok13messages: +
2008-05-16 07:25:23 donmez set type: enhancement
2008-05-16 07:25:03 donmez create