[issue12105] open() does not able to set flags, such as O_CLOEXEC

Charles-François Natali report at bugs.python.org
Mon May 23 14:06:40 CEST 2011


Charles-François Natali <neologix at free.fr> added the comment:

The real issue is that the libc defines O_CLOEXEC, but kernels prior to 2.6.23 don't support it: instead of returning EINVAL, the socket syscall silently ignores the flag (don't know why I made the comment about this flag being defined to 0...).
IMHO this is really a distribution packaging bug (kernel/libc mismatch), and a quite serious one.
I don't think we should be fixing this in Python, but that we should merely skip this test on kernels older than 2.6.23.
People should complain to their distributions vendors instead (I tested this on RHEL4, RHEL6 and Debian Squeeze without problem).

I personally don't like the idea of a best-effort O_CLOEXEC implementation: providing a O_CLOEXEC flag which is not atomic feels really wrong to me.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12105>
_______________________________________


More information about the Python-bugs-list mailing list