Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(83154)

Side by Side Diff: Doc/library/os.rst

Issue 27778: PEP 524: Add os.getrandom()
Patch Set: Created 2 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 :mod:`os` --- Miscellaneous operating system interfaces 1 :mod:`os` --- Miscellaneous operating system interfaces
2 ======================================================= 2 =======================================================
3 3
4 .. module:: os 4 .. module:: os
5 :synopsis: Miscellaneous operating system interfaces. 5 :synopsis: Miscellaneous operating system interfaces.
6 6
7 **Source code:** :source:`Lib/os.py` 7 **Source code:** :source:`Lib/os.py`
8 8
9 -------------- 9 --------------
10 10
(...skipping 3934 matching lines...) Expand 10 before | Expand all | Expand 10 after
3945 cryptographic purposes. 3945 cryptographic purposes.
3946 3946
3947 ``getrandom()`` relies on entropy gathered from device drivers and other 3947 ``getrandom()`` relies on entropy gathered from device drivers and other
3948 sources of environmental noise. Unnecessarily reading large quantities of 3948 sources of environmental noise. Unnecessarily reading large quantities of
3949 data will have a negative impact on other users of the ``/dev/random`` and 3949 data will have a negative impact on other users of the ``/dev/random`` and
3950 ``/dev/urandom`` devices. 3950 ``/dev/urandom`` devices.
3951 3951
3952 The flags argument is a bit mask that can contain zero or more of the 3952 The flags argument is a bit mask that can contain zero or more of the
3953 following values ORed together: :py:data:`os.GRND_RANDOM` and 3953 following values ORed together: :py:data:`os.GRND_RANDOM` and
3954 :py:data:`GRND_NONBLOCK`. 3954 :py:data:`GRND_NONBLOCK`.
3955
3956 The function can raise an :exc:`OSError` exception with the error number
3957 :data:`errno.ENOSYS`` if the Linux kernel does not support the
Martin Panter 2016/09/21 01:07:08 Double back-tick should probably be single. Same f
3958 :c:func:`getrandom` syscall.
3959
3960 The function can raise an :exc:`OSError` exception with the error number
3961 :data:`errno.EPERM`` if the :c:func:`getrandom` syscall is blocked, by a
3962 SECCOMP policy for example.
3955 3963
3956 See also the `Linux getrandom() manual page 3964 See also the `Linux getrandom() manual page
3957 <http://man7.org/linux/man-pages/man2/getrandom.2.html>`_. 3965 <http://man7.org/linux/man-pages/man2/getrandom.2.html>`_.
3958 3966
3959 Availability: Linux 3.17 and newer. 3967 Availability: Linux 3.17 and newer.
3960 3968
3961 .. versionadded:: 3.6 3969 .. versionadded:: 3.6
3962 3970
3963 .. function:: urandom(size) 3971 .. function:: urandom(size)
3964 3972
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
4010 block in these cases, but instead immediately raises :exc:`BlockingIOError`. 4018 block in these cases, but instead immediately raises :exc:`BlockingIOError`.
4011 4019
4012 .. versionadded:: 3.6 4020 .. versionadded:: 3.6
4013 4021
4014 .. data:: GRND_RANDOM 4022 .. data:: GRND_RANDOM
4015 4023
4016 If this bit is set, then random bytes are drawn from the 4024 If this bit is set, then random bytes are drawn from the
4017 ``/dev/random`` pool instead of the ``/dev/urandom`` pool. 4025 ``/dev/random`` pool instead of the ``/dev/urandom`` pool.
4018 4026
4019 .. versionadded:: 3.6 4027 .. versionadded:: 3.6
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+