bpo-38602: Add fcntl.F_OFD_XXXX for fcntlmodule (GH-16956)

This commit is contained in:
Dong-hee Na 2019-10-28 16:31:15 +09:00 committed by Serhiy Storchaka
parent 85c6f8c65c
commit 3bfc8e0fcc
4 changed files with 22 additions and 1 deletions

View File

@ -36,6 +36,8 @@ descriptor.
.. versionchanged:: 3.9
On macOS, the fcntl module exposes the ``F_GETPATH`` constant, which obtains
the path of a file from a file descriptor.
On Linux(>=3.15), the fcntl module exposes the ``F_OFD_GETLK``, ``F_OFD_SETLK``
and ``F_OFD_SETLKW`` constants, which working with open file description locks.
The module defines the following functions:

View File

@ -125,8 +125,15 @@ that schedules a shutdown for the default executor that waits on the
:func:`asyncio.run` has been updated to use the new :term:`coroutine`.
(Contributed by Kyle Stanley in :issue:`34037`.)
fcntl
-----
Added constants :data:`~fcntl.F_OFD_GETLK`, :data:`~fcntl.F_OFD_SETLK`
and :data:`~fcntl.F_OFD_SETLKW`.
(Contributed by Dong-hee Na in :issue:`38602`.)
os
__
--
Added :data:`~os.CLD_KILLED` and :data:`~os.CLD_STOPPED` for :attr:`si_code`.
(Contributed by Dong-hee Na in :issue:`38493`.)

View File

@ -0,0 +1,3 @@
Added constants :data:`~fcntl.F_OFD_GETLK`, :data:`~fcntl.F_OFD_SETLK`
and :data:`~fcntl.F_OFD_SETLKW` to the :mod:`fcntl` module.
Patch by Dong-hee Na.

View File

@ -495,6 +495,15 @@ all_ins(PyObject* m)
#ifdef F_SETLKW
if (PyModule_AddIntMacro(m, F_SETLKW)) return -1;
#endif
#ifdef F_OFD_GETLK
if (PyModule_AddIntMacro(m, F_OFD_GETLK)) return -1;
#endif
#ifdef F_OFD_SETLK
if (PyModule_AddIntMacro(m, F_OFD_SETLK)) return -1;
#endif
#ifdef F_OFD_SETLKW
if (PyModule_AddIntMacro(m, F_OFD_SETLKW)) return -1;
#endif
#ifdef F_GETOWN
if (PyModule_AddIntMacro(m, F_GETOWN)) return -1;
#endif