Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e83ed432
Commit
e83ed432
authored
Jan 18, 2014
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve description of buffers argument for readv/writev (closes #17811)
Patch by Nikolaus Rath.
parent
a96860c9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
14 deletions
+22
-14
Doc/library/os.rst
Doc/library/os.rst
+12
-8
Modules/posixmodule.c
Modules/posixmodule.c
+10
-6
No files found.
Doc/library/os.rst
View file @
e83ed432
...
@@ -1019,9 +1019,12 @@ as internal buffering of data.
...
@@ -1019,9 +1019,12 @@ as internal buffering of data.
.. function:: readv(fd, buffers)
.. function:: readv(fd, buffers)
Read from a file descriptor into a number of writable buffers. *buffers* is
Read from a file descriptor *fd* into a number of mutable :term:`bytes-like
an arbitrary sequence of writable buffers. Returns the total number of bytes
objects <bytes-like object>` *buffers*. :func:`~os.readv` will transfer data
read.
into each buffer until it is full and then move on to the next buffer in the
sequence to hold the rest of the data. :func:`~os.readv` returns the total
number of bytes read (which may be less than the total capacity of all the
objects).
Availability: Unix.
Availability: Unix.
...
@@ -1071,9 +1074,10 @@ as internal buffering of data.
...
@@ -1071,9 +1074,10 @@ as internal buffering of data.
.. function:: writev(fd, buffers)
.. function:: writev(fd, buffers)
Write the contents of *buffers* to file descriptor *fd*, where *buffers*
Write the contents of *buffers* to file descriptor *fd*. *buffers* must be a
is an arbitrary sequence of buffers.
sequence of :term:`bytes-like objects <bytes-like object>`.
Returns the total number of bytes written.
:func:`~os.writev` writes the contents of each object to the file descriptor
and returns the total number of bytes written.
Availability: Unix.
Availability: Unix.
...
...
Modules/posixmodule.c
View file @
e83ed432
...
@@ -8100,9 +8100,12 @@ iov_cleanup(struct iovec *iov, Py_buffer *buf, int cnt)
...
@@ -8100,9 +8100,12 @@ iov_cleanup(struct iovec *iov, Py_buffer *buf, int cnt)
#ifdef HAVE_READV
#ifdef HAVE_READV
PyDoc_STRVAR
(
posix_readv__doc__
,
PyDoc_STRVAR
(
posix_readv__doc__
,
"readv(fd, buffers) -> bytesread
\n\n
\
"readv(fd, buffers) -> bytesread
\n\n
\
Read from a file descriptor into a number of writable buffers. buffers
\n
\
Read from a file descriptor fd into a number of mutable, bytes-like
\n
\
is an arbitrary sequence of writable buffers.
\n
\
objects (
\"
buffers
\"
). readv will transfer data into each buffer
\n
\
Returns the total number of bytes read."
);
until it is full and then move on to the next buffer in the sequence
\n
\
to hold the rest of the data.
\n\n
\
readv returns the total number of bytes read (which may be less than
\n
\
the total capacity of all the buffers."
);
static
PyObject
*
static
PyObject
*
posix_readv
(
PyObject
*
self
,
PyObject
*
args
)
posix_readv
(
PyObject
*
self
,
PyObject
*
args
)
...
@@ -8465,9 +8468,10 @@ posix_pipe2(PyObject *self, PyObject *arg)
...
@@ -8465,9 +8468,10 @@ posix_pipe2(PyObject *self, PyObject *arg)
#ifdef HAVE_WRITEV
#ifdef HAVE_WRITEV
PyDoc_STRVAR
(
posix_writev__doc__
,
PyDoc_STRVAR
(
posix_writev__doc__
,
"writev(fd, buffers) -> byteswritten
\n\n
\
"writev(fd, buffers) -> byteswritten
\n\n
\
Write the contents of buffers to a file descriptor, where buffers is an
\n
\
Write the contents of *buffers* to file descriptor *fd*. *buffers*
\n
\
arbitrary sequence of buffers.
\n
\
must be a sequence of bytes-like objects.
\n\n
\
Returns the total bytes written."
);
writev writes the contents of each object to the file descriptor
\n
\
and returns the total number of bytes written."
);
static
PyObject
*
static
PyObject
*
posix_writev
(
PyObject
*
self
,
PyObject
*
args
)
posix_writev
(
PyObject
*
self
,
PyObject
*
args
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment