This is a convenience function to raise an exception when a C library function
has returned an error and set the C variable :c:data:`errno`. It constructs a
tuple object whose first item is the integer :c:data:`errno` value and whose
- second item is the corresponding error message (gotten from :c:func:`strerror`),
+ second item is the corresponding error message (gotten from :c:func:`!strerror`),
and then calls ``PyErr_SetObject(type, object)``. On Unix, when the
:c:data:`errno` value is :c:macro:`EINTR`, indicating an interrupted system call,
this calls :c:func:`PyErr_CheckSignals`, and if that set the error indicator,
.. c:function:: PyOS_sighandler_t PyOS_getsig(int i)
Return the current signal handler for signal *i*. This is a thin wrapper around
- either :c:func:`sigaction` or :c:func:`signal`. Do not call those functions
+ either :c:func:`!sigaction` or :c:func:`!signal`. Do not call those functions
directly! :c:type:`PyOS_sighandler_t` is a typedef alias for :c:expr:`void
(\*)(int)`.
.. c:function:: PyOS_sighandler_t PyOS_setsig(int i, PyOS_sighandler_t h)
Set the signal handler for signal *i* to be *h*; return the old signal handler.
- This is a thin wrapper around either :c:func:`sigaction` or :c:func:`signal`. Do
+ This is a thin wrapper around either :c:func:`!sigaction` or :c:func:`!signal`. Do
not call those functions directly! :c:type:`PyOS_sighandler_t` is a typedef
alias for :c:expr:`void (\*)(int)`.
exclude_patterns.append(venvdir + '/*')
nitpick_ignore = [
+ # Standard C functions
+ ('c:func', 'calloc'),
+ ('c:func', 'dlopen'),
+ ('c:func', 'exec'),
+ ('c:func', 'fcntl'),
+ ('c:func', 'fork'),
+ ('c:func', 'free'),
+ ('c:func', 'gmtime'),
+ ('c:func', 'localtime'),
+ ('c:func', 'main'),
+ ('c:func', 'malloc'),
+ ('c:func', 'printf'),
+ ('c:func', 'realloc'),
+ ('c:func', 'snprintf'),
+ ('c:func', 'sprintf'),
+ ('c:func', 'stat'),
+ ('c:func', 'system'),
+ ('c:func', 'vsnprintf'),
# Standard C types
('c:type', 'FILE'),
('c:type', '__int'),
.. object:: function__return(str filename, str funcname, int lineno)
- This marker is the converse of :c:func:`function__entry`, and indicates that
+ This marker is the converse of :c:func:`!function__entry`, and indicates that
execution of a Python function has ended (either via ``return``, or via an
exception). It is only triggered for pure-Python (bytecode) functions.
- The arguments are the same as for :c:func:`function__entry`
+ The arguments are the same as for :c:func:`!function__entry`
.. object:: line(str filename, str funcname, int lineno)
the equivalent of line-by-line tracing with a Python profiler. It is
not triggered within C functions.
- The arguments are the same as for :c:func:`function__entry`.
+ The arguments are the same as for :c:func:`!function__entry`.
.. object:: gc__start(int generation)
unlock()
Three locking mechanisms are used---dot locking and, if available, the
- :c:func:`flock` and :c:func:`lockf` system calls.
+ :c:func:`!flock` and :c:func:`!lockf` system calls.
.. seealso::
unlock()
Three locking mechanisms are used---dot locking and, if available, the
- :c:func:`flock` and :c:func:`lockf` system calls. For MH mailboxes, locking
+ :c:func:`!flock` and :c:func:`!lockf` system calls. For MH mailboxes, locking
the mailbox means locking the :file:`.mh_sequences` file and, only for the
duration of any operations that affect them, locking individual message
files.
unlock()
Three locking mechanisms are used---dot locking and, if available, the
- :c:func:`flock` and :c:func:`lockf` system calls.
+ :c:func:`!flock` and :c:func:`!lockf` system calls.
.. seealso::
unlock()
Three locking mechanisms are used---dot locking and, if available, the
- :c:func:`flock` and :c:func:`lockf` system calls.
+ :c:func:`!flock` and :c:func:`!lockf` system calls.
.. seealso::
.. function:: getsid(pid, /)
- Call the system call :c:func:`getsid`. See the Unix manual for the semantics.
+ Call the system call :c:func:`!getsid`. See the Unix manual for the semantics.
.. availability:: Unix, not Emscripten, not WASI.
.. function:: setsid()
- Call the system call :c:func:`setsid`. See the Unix manual for the semantics.
+ Call the system call :c:func:`!setsid`. See the Unix manual for the semantics.
.. availability:: Unix, not Emscripten, not WASI.
.. function:: strerror(code, /)
Return the error message corresponding to the error code in *code*.
- On platforms where :c:func:`strerror` returns ``NULL`` when given an unknown
+ On platforms where :c:func:`!strerror` returns ``NULL`` when given an unknown
error number, :exc:`ValueError` is raised.
--------------
-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
polling object; see section :ref:`devpoll-objects` below for the
methods supported by devpoll objects.
- :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:
.. index:: single: WinSock
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.
``/dev/poll`` Polling Objects
-----------------------------
-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.
implement :meth:`!fileno`, so they can also be used as the argument.
*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`.
Registering a file descriptor that's already registered is not an
error, but the result is undefined. The appropriate action is to
unregister or modify it first. This is an important difference
- compared with :c:func:`poll`.
+ compared with :c:func:`!poll`.
.. method:: devpoll.modify(fd[, eventmask])
Polling Objects
---------------
-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])
Note that installing a signal handler with :func:`signal` will reset the
restart behaviour to interruptible by implicitly calling
- :c:func:`siginterrupt` with a true *flag* value for the given signal.
+ :c:func:`!siginterrupt` with a true *flag* value for the given signal.
.. function:: signal(signalnum, handler)
Doc/howto/curses.rst
Doc/howto/descriptor.rst
Doc/howto/enum.rst
-Doc/howto/instrumentation.rst
Doc/howto/isolating-extensions.rst
Doc/howto/logging-cookbook.rst
Doc/howto/logging.rst
(Contributed by Raymond Hettinger; :issue:`1861`.)
* The :mod:`select` module now has wrapper functions
- for the Linux :c:func:`epoll` and BSD :c:func:`kqueue` system calls.
+ for the Linux :c:func:`!epoll` and BSD :c:func:`!kqueue` system calls.
:meth:`modify` method was added to the existing :class:`poll`
objects; ``pollobj.modify(fd, eventmask)`` takes a file descriptor
or file object and an event mask, modifying the recorded event mask
one for reading and one for writing. The writable descriptor
will be passed to :func:`set_wakeup_fd`, and the readable descriptor
will be added to the list of descriptors monitored by the event loop via
- :c:func:`select` or :c:func:`poll`.
+ :c:func:`!select` or :c:func:`!poll`.
On receiving a signal, a byte will be written and the main event loop
will be woken up, avoiding the need to poll.
* Python now must be compiled with C89 compilers (after 19
years!). This means that the Python source tree has dropped its
- own implementations of :c:func:`memmove` and :c:func:`strerror`, which
+ own implementations of :c:func:`!memmove` and :c:func:`!strerror`, which
are in the C89 standard library.
* Python 2.6 can be built with Microsoft Visual Studio 2008 (version
This means Python now supports three different modules for parsing
command-line arguments: :mod:`getopt`, :mod:`optparse`, and
:mod:`argparse`. The :mod:`getopt` module closely resembles the C
-library's :c:func:`getopt` function, so it remains useful if you're writing a
+library's :c:func:`!getopt` function, so it remains useful if you're writing a
Python prototype that will eventually be rewritten in C.
:mod:`optparse` becomes redundant, but there are no plans to remove it
because there are many scripts still using it, and there's no
.. section: Core and Builtins
The implementation of :func:`signal.siginterrupt` now uses
-:c:func:`sigaction` (if it is available in the system) instead of the
-deprecated :c:func:`siginterrupt`. Patch by Pablo Galindo.
+:c:func:`!sigaction` (if it is available in the system) instead of the
+deprecated :c:func:`!siginterrupt`. Patch by Pablo Galindo.
..