Commit 8cbb5b66 authored by Christian Heimes's avatar Christian Heimes Committed by GitHub

bpo-26835: Add file sealing constants to fcntl (GH-13694)

Co-authored-by: default avatarnanjekyejoannah <nanjekyejoannah@gmail.com>
parent ffed76b6
...@@ -28,6 +28,10 @@ descriptor. ...@@ -28,6 +28,10 @@ descriptor.
Operations in this module used to raise an :exc:`IOError` where they now Operations in this module used to raise an :exc:`IOError` where they now
raise an :exc:`OSError`. raise an :exc:`OSError`.
.. versionchanged:: 3.8
The fcntl module now contains ``F_ADD_SEALS``, ``F_GET_SEALS``, and
``F_SEAL_*`` constants for sealing of :func:`os.memfd_create` file
descriptors.
The module defines the following functions: The module defines the following functions:
......
The fcntl module now contains file sealing constants for sealing of memfds.
...@@ -620,7 +620,15 @@ all_ins(PyObject* m) ...@@ -620,7 +620,15 @@ all_ins(PyObject* m)
if (PyModule_AddIntMacro(m, I_PLINK)) return -1; if (PyModule_AddIntMacro(m, I_PLINK)) return -1;
if (PyModule_AddIntMacro(m, I_PUNLINK)) return -1; if (PyModule_AddIntMacro(m, I_PUNLINK)) return -1;
#endif #endif
#ifdef F_ADD_SEALS
/* Linux: file sealing for memfd_create() */
if (PyModule_AddIntMacro(m, F_ADD_SEALS)) return -1;
if (PyModule_AddIntMacro(m, F_GET_SEALS)) return -1;
if (PyModule_AddIntMacro(m, F_SEAL_SEAL)) return -1;
if (PyModule_AddIntMacro(m, F_SEAL_SHRINK)) return -1;
if (PyModule_AddIntMacro(m, F_SEAL_GROW)) return -1;
if (PyModule_AddIntMacro(m, F_SEAL_WRITE)) return -1;
#endif
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment