diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-07-29 20:32:47 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-07-29 20:32:47 (GMT) |
commit | 1db9e7bb19909ed56821b1580cbb024faccac041 (patch) | |
tree | 20043197ec08844340c9ac039fe26c630bd4189d /Doc | |
parent | 6aa4269ed25f7fdddd99fe1d7b09b8406ecb05ea (diff) | |
download | cpython-1db9e7bb19909ed56821b1580cbb024faccac041.zip cpython-1db9e7bb19909ed56821b1580cbb024faccac041.tar.gz cpython-1db9e7bb19909ed56821b1580cbb024faccac041.tar.bz2 |
Issue #22054: Add os.get_blocking() and os.set_blocking() functions to get and
set the blocking mode of a file descriptor (False if the O_NONBLOCK flag is
set, True otherwise). These functions are not available on Windows.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/os.rst | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst index c03ce65..9cfc472 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -807,6 +807,17 @@ as internal buffering of data. Availability: Unix. +.. function:: get_blocking(fd) + + Get the blocking mode of the file descriptor: ``False`` if the + :data:`O_NONBLOCK` flag is set, ``True`` if the flag is cleared. + + See also :func:`set_blocking` and :meth:`socket.socket.setblocking`. + + Availability: Unix. + + .. versionadded:: 3.5 + .. function:: isatty(fd) Return ``True`` if the file descriptor *fd* is open and connected to a @@ -1107,6 +1118,18 @@ or `the MSDN <http://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Window .. versionadded:: 3.3 +.. function:: set_blocking(fd, blocking) + + Set the blocking mode of the specified file descriptor. Set the + :data:`O_NONBLOCK` flag if blocking is ``False``, clear the flag otherwise. + + See also :func:`get_blocking` and :meth:`socket.socket.setblocking`. + + Availability: Unix. + + .. versionadded:: 3.5 + + .. data:: SF_NODISKIO SF_MNOWAIT SF_SYNC |