[New-bugs-announce] [issue22042] signal.set_wakeup_fd(fd): set the fd to non-blocking mode

STINNER Victor report at bugs.python.org
Wed Jul 23 02:49:30 CEST 2014

New submission from STINNER Victor:

I think that signal.set_wakeup_fd(fd) must set the file descriptor to the non-blocking mode, instead of requiring the file descriptor mode to be non-blocking.

Atttached patch implements this idea.

See also the issue #22018 which proposes to support sockets in signal.set_wakeup_fd(fd) on Windows.

We have to decide if signal.set_wakeup_fd() is supposed to support files or not on Windows. Non-blocking mode does not exist for files on Windows, only for sockets.

I didn't test my patch on Windows yet.

Note: the new _Py_set_blocking() function tries to use ioctl() instead of fnctl() when available to only use one syscall instead of two. I used the same optimization in _Py_set_inheritable().

files: signal_nonblock.patch
keywords: patch
messages: 223710
nosy: haypo
priority: normal
severity: normal
status: open
title: signal.set_wakeup_fd(fd): set the fd to non-blocking mode
versions: Python 3.5
Added file: http://bugs.python.org/file36039/signal_nonblock.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list