From: Antoine Pitrou Date: Tue, 13 Jun 2017 08:14:09 +0000 (+0200) Subject: Mention how to disable signal fd wakeup (#2140) X-Git-Tag: v3.7.0a1~611 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d79c1d4a9406384f10a37f26a7515ce79f9fdd78;p=python Mention how to disable signal fd wakeup (#2140) --- diff --git a/Doc/library/signal.rst b/Doc/library/signal.rst index 039b666475..46d71def08 100644 --- a/Doc/library/signal.rst +++ b/Doc/library/signal.rst @@ -306,8 +306,10 @@ The :mod:`signal` module defines the following functions: a library to wakeup a poll or select call, allowing the signal to be fully processed. - The old wakeup fd is returned. *fd* must be non-blocking. It is up to the - library to remove any bytes before calling poll or select again. + The old wakeup fd is returned (or -1 if file descriptor wakeup was not + enabled). If *fd* is -1, file descriptor wakeup is disabled. + If not -1, *fd* must be non-blocking. It is up to the library to remove + any bytes from *fd* before calling poll or select again. Use for example ``struct.unpack('%uB' % len(data), data)`` to decode the signal numbers list.