New submission from STINNER Victor: Attached patch is avoids a syscall in os.set_inheritable() if the FD_CLOEXEC flag is already set/cleared.
The change only impacts platforms using fcntl() in _Py_set_inheritable(). Windows has a different implementation, and Linux uses ioctl() for example. The same "optimization" is used in socket.socket.setblocking(): see the issue #19827. ---------- files: set_inheritable_fcntl.patch keywords: patch messages: 263493 nosy: haypo priority: normal severity: normal status: open title: _Py_set_inheritable(): do nothing if the FD_CLOEXEC close is already set/cleared type: performance versions: Python 3.6 Added file: http://bugs.python.org/file42472/set_inheritable_fcntl.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26770> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com