[3.12] gh-106948: Docs: Disable links for C standard library functions, OS utility functions and system calls (GH-107062) by miss-islington · Pull Request #107154 · python/cpython
--------------
This module provides access to the :c:func:`select` and :c:func:`poll` functions available in most operating systems, :c:func:`devpoll` available on Solaris and derivatives, :c:func:`epoll` available on Linux 2.5+ and :c:func:`kqueue` available on most BSD. This module provides access to the :c:func:`!select` and :c:func:`!poll` functions available in most operating systems, :c:func:`!devpoll` available on Solaris and derivatives, :c:func:`!epoll` available on Linux 2.5+ and :c:func:`!kqueue` available on most BSD. Note that on Windows, it only works for sockets; on other operating systems, it also works for other file types (in particular, on Unix, it works on pipes). It cannot be used on regular files to determine whether a file has grown since
:c:func:`devpoll` objects are linked to the number of file :c:func:`!devpoll` objects are linked to the number of file descriptors allowed at the time of instantiation. If your program reduces this value, :c:func:`devpoll` will fail. If your program increases this value, :c:func:`devpoll` may return an reduces this value, :c:func:`!devpoll` will fail. If your program increases this value, :c:func:`!devpoll` may return an incomplete list of active file descriptors.
The new file descriptor is :ref:`non-inheritable <fd_inheritance>`.
*sizehint* informs epoll about the expected number of events to be registered. It must be positive, or ``-1`` to use the default. It is only used on older systems where :c:func:`epoll_create1` is not available; used on older systems where :c:func:`!epoll_create1` is not available; otherwise it has no effect (though its value is still checked).
*flags* is deprecated and completely ignored. However, when supplied, its
.. function:: select(rlist, wlist, xlist[, timeout])
This is a straightforward interface to the Unix :c:func:`select` system call. This is a straightforward interface to the Unix :c:func:`!select` system call. The first three arguments are iterables of 'waitable objects': either integers representing file descriptors or objects with a parameterless method named :meth:`~io.IOBase.fileno` returning such an integer:
File objects on Windows are not acceptable, but sockets are. On Windows, the underlying :c:func:`select` function is provided by the WinSock the underlying :c:func:`!select` function is provided by the WinSock library, and does not handle file descriptors that don't originate from WinSock.
The minimum number of bytes which can be written without blocking to a pipe when the pipe has been reported as ready for writing by :func:`~select.select`, :func:`poll` or another interface in this module. This doesn't apply :func:`!poll` or another interface in this module. This doesn't apply to other kind of file-like objects such as sockets.
This value is guaranteed by POSIX to be at least 512.
Solaris and derivatives have ``/dev/poll``. While :c:func:`select` is O(highest file descriptor) and :c:func:`poll` is O(number of file Solaris and derivatives have ``/dev/poll``. While :c:func:`!select` is O(highest file descriptor) and :c:func:`!poll` is O(number of file descriptors), ``/dev/poll`` is O(active file descriptors).
``/dev/poll`` behaviour is very close to the standard :c:func:`poll` ``/dev/poll`` behaviour is very close to the standard :c:func:`!poll` object.
*eventmask* is an optional bitmask describing the type of events you want to check for. The constants are the same that with :c:func:`poll` check for. The constants are the same that with :c:func:`!poll` object. The default value is a combination of the constants :const:`POLLIN`, :const:`POLLPRI`, and :const:`POLLOUT`.
.. method:: devpoll.modify(fd[, eventmask])
The :c:func:`poll` system call, supported on most Unix systems, provides better The :c:func:`!poll` system call, supported on most Unix systems, provides better scalability for network servers that service many, many clients at the same time. :c:func:`poll` scales better because the system call only requires listing the file descriptors of interest, while :c:func:`select` builds a bitmap, turns time. :c:func:`!poll` scales better because the system call only requires listing the file descriptors of interest, while :c:func:`!select` builds a bitmap, turns on bits for the fds of interest, and then afterward the whole bitmap has to be linearly scanned again. :c:func:`select` is O(highest file descriptor), while :c:func:`poll` is O(number of file descriptors). linearly scanned again. :c:func:`!select` is O(highest file descriptor), while :c:func:`!poll` is O(number of file descriptors).
.. method:: poll.register(fd[, eventmask])