]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Adds the select.PIPE_BUF attribute to expose the system constant.
authorGregory P. Smith <greg@mad-scientist.com>
Fri, 3 Jul 2009 20:48:31 +0000 (20:48 +0000)
committerGregory P. Smith <greg@mad-scientist.com>
Fri, 3 Jul 2009 20:48:31 +0000 (20:48 +0000)
Doc/library/select.rst
Modules/selectmodule.c

index 351ecfa2be58e748eb97f1f2c38c8d72ad4308b1..469fbac71e321bcb031649075f8c0721449416cb 100644 (file)
@@ -100,6 +100,15 @@ The module defines the following:
       library, and does not handle file descriptors that don't originate from
       WinSock.
 
+.. attribute:: select.PIPE_BUF
+
+   Files reported as ready for writing by :func:`select`, :func:`poll` or
+   similar interfaces in this module are guaranteed to not block on a write
+   of up to :const:`PIPE_BUF` bytes.
+   This value is guaranteed by POSIX to be at least 512.
+
+   .. versionadded:: 2.7
+
 
 .. _epoll-objects:
 
index 2638bdc7b6dd805f6857bbbc6fbde99acc72ab4d..a40581270175ffefb03538d500fcc88f861388f3 100644 (file)
@@ -1746,6 +1746,8 @@ initselect(void)
        Py_INCREF(SelectError);
        PyModule_AddObject(m, "error", SelectError);
 
+       PyModule_AddIntConstant(m, "PIPE_BUF", PIPE_BUF);
+
 #if defined(HAVE_POLL)
 #ifdef __APPLE__
        if (select_have_broken_poll()) {