msg207121 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2013-12-31 15:58 |
http://docs.python.org/dev/library/select.html#select.epoll documents the EPOLL_CLOEXEC flag as something you can specify that makes the file descriptor be closed on exec. But then it goes on to say that the file descriptor is non-inheritable. So is the flag useless and should be removed from the docs, or is the documentation just unclear as to its purpose? Or, conversely, do we need a way to say that the file descriptor should *not* be closed on exec? |
|
|
msg207124 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2013-12-31 16:19 |
Use os.set_inheritable(epoll.fileno(), True) to make the file descriptor inheritable. You should find this info easily if you follow the link on "non inheritable" in epoll documentation. EPOLL_CLOEXEC becomes useless in Python 3.4. It is used internally by default if available. Removing it would break existing code, it would be harder to write code for python 3.4 and 3.3. Just update the doc. |
|
|
msg275141 - (view) |
Author: Berker Peksag (berker.peksag) *  |
Date: 2016-09-08 20:31 |
Thanks for the patch, priyapappachan. Here is an updated patch. Since EPOLL_CLOEXEC is the only value that can be passed to epoll_create1(), we can also simplify the implementation a bit. |
|
|
msg275783 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2016-09-11 12:45 |
New changeset 9023c4f5d467 by Berker Peksag in branch '3.5': Issue #20100: Clarify that passing flags to epoll() has no effect https://hg.python.org/cpython/rev/9023c4f5d467 New changeset d2b5806fa770 by Berker Peksag in branch 'default': Issue #20100: Merge from 3.5 https://hg.python.org/cpython/rev/d2b5806fa770 |
|
|
msg275787 - (view) |
Author: Berker Peksag (berker.peksag) *  |
Date: 2016-09-11 13:11 |
Here is an updated patch for Modules/selectmodule.c. It would be nice to get a code review. |
|
|
msg275978 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2016-09-12 06:49 |
There is small behavior difference. Currently OSError raised for invalid flags has errno=EINVAL, with the patch it wouldn't have errno. If this is okay, the patch LGTM. |
|
|
msg277466 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2016-09-26 20:28 |
New changeset ac24e5c2fd3e by Berker Peksag in branch 'default': Issue #20100: Simplify newPyEpoll_Object() https://hg.python.org/cpython/rev/ac24e5c2fd3e |
|
|
msg277473 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2016-09-26 22:17 |
I dislike this change. Python is not responsible to check parameters of OS syscalls, this function should be a thin wrapper to the OS function. Linux may add new flags in the future. Le lundi 26 septembre 2016, Roundup Robot <report@bugs.python.org> a écrit : > > Roundup Robot added the comment: > > New changeset ac24e5c2fd3e by Berker Peksag in branch 'default': > Issue #20100: Simplify newPyEpoll_Object() > https://hg.python.org/cpython/rev/ac24e5c2fd3e > > ---------- > > _______________________________________ > Python tracker <report@bugs.python.org javascript:;> > <http://bugs.python.org/issue20100> > _______________________________________ > |
|
|
msg277505 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2016-09-27 08:25 |
Old code looked strange after : flags |= EPOLL_CLOEXEC; if (flags) self->epfd = epoll_create1(flags); else The condition is always true unless EPOLL_CLOEXEC is 0. |
|
|
msg277507 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2016-09-27 08:50 |
> Old code looked strange after : epoll_create() is a deprecated. epoll_create(size): "Since Linux 2.6.8, the size argument is ignored, but must be greater than zero" according to the man page. So it's fine to always call epoll_create1(flags). Example of new potential new flag for epoll_create1(): ten years ago, EPOLL_NONBLOCK was proposed: https://lkml.org/lkml/2008/8/24/130 (but it seems like it doesn't make sense, since the syscall cannot block) Recent epoll evolutions don't seem to be on epoll_create1(): https://lwn.net/Articles/633422/ |
|
|