Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move preadv to fix ordering
  • Loading branch information
vstinner committed Jan 29, 2018
commit 622a8ec053f54f933d57bb8e8346f8e92e56890f
116 changes: 58 additions & 58 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,64 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
.. versionadded:: 3.3


.. function:: preadv(fd, buffers, offset, flags=0)

Read from a file descriptor *fd* from offset *offset* into mutable
:term:`bytes-like objects <bytes-like object>` *buffers*. Transfer 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.

Return the total number of bytes read which can be less than the total
capacity of all the objects.

Combine the functionality of :func:`os.readv` and :func:`os.pread`.

The flags argument contains a bitwise OR of zero or more of the following
flags:

- :data:`RWF_HIPRI`
- :data:`RWF_NOWAIT`

Using non-zero flags requires Linux 4.6 or newer.

The operating system may set a limit (:func:`sysconf` value
``'SC_IOV_MAX'``) on the number of buffers that can be used.

Availability: Linux 2.6.30 abd newer, FreeBSD 6.0 and newer,
OpenBSD 2.7 and newer.

.. versionadded:: 3.7


.. data:: RWF_NOWAIT

Do not wait for data which is not immediately available. If this flag is
specified, the system call will return instantly if it would have to read
data from the backing storage or wait for a lock.

If some data was successfully read, it will return the number of bytes read.
If no bytes were read, it will return ``-1`` and set errno to
:data:`errno.EAGAIN`.

Availability: Linux 4.14 and newer.

.. versionadded:: 3.7


.. data:: RWF_HIPRI

High priority read/write. Allows block-based filesystems to use polling
of the device, which provides lower latency, but may use additional
resources.

Currently, on Linux, this feature is usable only on a file descriptor opened
using the O_DIRECT flag.

Availability: Linux 4.6 and newer.

.. versionadded:: 3.7


.. function:: pwrite(fd, str, offset)

Write *bytestring* to a file descriptor, *fd*, from *offset*,
Expand Down Expand Up @@ -1244,64 +1302,6 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
.. versionadded:: 3.3


.. function:: preadv(fd, buffers, offset, flags=0)

Read from a file descriptor *fd* from offset *offset* into mutable
:term:`bytes-like objects <bytes-like object>` *buffers*. Transfer 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.

Return the total number of bytes read which can be less than the total
capacity of all the objects.

Combine the functionality of :func:`os.readv` and :func:`os.pread`.

The flags argument contains a bitwise OR of zero or more of the following
flags:

- :data:`RWF_HIPRI`
- :data:`RWF_NOWAIT`

Using non-zero flags requires Linux 4.6 or newer.

The operating system may set a limit (:func:`sysconf` value
``'SC_IOV_MAX'``) on the number of buffers that can be used.

Availability: Linux 2.6.30 abd newer, FreeBSD 6.0 and newer,
OpenBSD 2.7 and newer.

.. versionadded:: 3.7


.. data:: RWF_NOWAIT

Do not wait for data which is not immediately available. If this flag is
specified, the system call will return instantly if it would have to read
data from the backing storage or wait for a lock.

If some data was successfully read, it will return the number of bytes read.
If no bytes were read, it will return ``-1`` and set errno to
:data:`errno.EAGAIN`.

Availability: Linux 4.14 and newer.

.. versionadded:: 3.7


.. data:: RWF_HIPRI

High priority read/write. Allows block-based filesystems to use polling
of the device, which provides lower latency, but may use additional
resources.

Currently, on Linux, this feature is usable only on a file descriptor opened
using the O_DIRECT flag.

Availability: Linux 4.6 and newer.

.. versionadded:: 3.7


.. function:: tcgetpgrp(fd)

Return the process group associated with the terminal given by *fd* (an open
Expand Down