Repository navigation
bpo-31368: Expose preadv (preadv2) and pwritev (pwritev2) in the os module #5239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
ea21128
4570976
21a3004
8a2a2a3
c0c53dc
4ddbca9
cac62ac
c7b7285
58910d0
f7cdf22
47f65b5
87c6970
cb74d38
5563b8d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1104,10 +1104,10 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo | |
| .. function:: pwritev(fd, buffers, offset, flags=0) | ||
|
|
||
| Combines the functionality of :func:`os.writev` and :func:`os.pwrite`. It | ||
| writes the contents of *buffers* to file descriptor *fd*. *buffers* must be | ||
| a sequence of :term:`bytes-like objects <bytes-like object>`. Buffers are | ||
| processed in array order. Entire contents of first buffer is written before | ||
| proceeding to second, and so on. The operating system may set a limit | ||
| writes the contents of *buffers* to file descriptor *fd* at offset *offset*. | ||
| *buffers* must be a sequence of :term:`bytes-like objects <bytes-like object>`. | ||
| Buffers are processed in array order. Entire contents of first buffer is written | ||
| before proceeding to second, and so on. The operating system may set a limit | ||
| (sysconf() value SC_IOV_MAX) on the number of buffers that can be used. | ||
| :func:`~os.pwritev` writes the contents of each object to the file descriptor | ||
| and returns the total number of bytes written. | ||
|
|
@@ -1116,18 +1116,18 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo | |
| The *flags* argument contains a bitwise OR of zero or more of the following | ||
| flags: | ||
|
|
||
| - RWF_DSYNC | ||
| - RWF_SYNC | ||
| - RWF_DSYNC | ||
| - RWF_SYNC | ||
|
|
||
| :func:`~os.pwritev` will call *pwritev2* system call if available, which modifies | ||
| the behavior on a per-call basis based on the value of the *flags* argument. The | ||
| :func:`~os.pwritev2` function is required to pass flags. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, there is no :func: I suggested "The C function :func: |
||
|
|
||
| *pwritev2* and *flags* different than zero are available since Linux version | ||
| 4.7 and newer. | ||
|
|
||
| The :func:`~os.pwritev2` function is required to pass flags. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: I would move this sentence before describing on which Linux platforms version it is available.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto, don't write ":func: Note the "c" prefix before "func". |
||
|
|
||
| *pwritev2* and *flags* different than zero are available since Linux version | ||
| 4.7. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "The :func: I'm not sure that the Python has to mention pwritev2(). It's confusing and useless. I don't think that the documentation of other os function lists each internal called C functions. I suggest something simpler like: "Using non-zero flags requires Linux 4.7 or newer." |
||
|
|
||
| Availability: Linux (version 2.6.30), FreeBSD 6.0 and newer, | ||
| OpenBSD (version 2.7 and newer). | ||
|
|
||
|
|
@@ -1246,7 +1246,7 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo | |
| data 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. Its fourth argument, *offset*, | ||
| specifies the file offset at which the input operation is to be performed. | ||
| :func:`~os.preadv` return the total number of bytes read (which may be less than | ||
| :func:`~os.preadv` return the total number of bytes read (which can be less than | ||
| the total capacity of all the objects). | ||
|
|
||
| The flags argument contains a bitwise OR of zero or more of the following | ||
|
|
@@ -1257,7 +1257,7 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo | |
|
|
||
| :func:`~os.preadv` will call *preadv2* system call if available, which modifies | ||
| the behavior on a per-call basis based on the value of the *flags* argument. The | ||
| :func:`~os.preadv2` function is required to pass flags. | ||
| :c:func:`preadv2` function is required to pass flags. | ||
|
|
||
| *preadv2* and flags different than zero are available since Linux version | ||
| 4.6 and newer. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that ", which modifies the behavior on a per-call basis based on the value of the flags argument." is needed. Nobody expects a flag passed to a function to have an effect on following calls. And the usage of pwrite2() doesn't mean that the caller must pass a non-zero flags. This sentence is confusing.