Skip to content

Commit f917c24

Browse files
authored
bpo-43106: Add os.O_EVTONLY/O_FSYNC/O_SYMLINK/O_NOFOLLOW_ANY (pythonGH-24428)
1 parent d4e6ed7 commit f917c24

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

Doc/library/os.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,16 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
10901090

10911091
The above constants are only available on Windows.
10921092

1093+
.. data:: O_EVTONLY
1094+
O_FSYNC
1095+
O_SYMLINK
1096+
O_NOFOLLOW_ANY
1097+
1098+
The above constants are only available on macOS.
1099+
1100+
.. versionchanged:: 3.10
1101+
Add :data:`O_EVTONLY`, :data:`O_FSYNC`, :data:`O_SYMLINK`
1102+
and :data:`O_NOFOLLOW_ANY` constants.
10931103

10941104
.. data:: O_ASYNC
10951105
O_DIRECT

Doc/whatsnew/3.10.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,10 @@ descriptors without copying between kernel address space and user
411411
address space, where one of the file descriptors must refer to a
412412
pipe. (Contributed by Pablo Galindo in :issue:`41625`.)
413413
414+
Added :data:`~os.O_EVTONLY`, :data:`~os.O_FSYNC`, :data:`~os.O_SYMLINK`
415+
and :data:`~os.O_NOFOLLOW_ANY` for macOS.
416+
(Contributed by Dong-hee Na in :issue:`43106`.)
417+
414418
pathlib
415419
-------
416420
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Added :data:`~os.O_EVTONLY`, :data:`~os.O_FSYNC`, :data:`~os.O_SYMLINK`
2+
and :data:`~os.O_NOFOLLOW_ANY` for macOS. Patch by Dong-hee Na.

Modules/posixmodule.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14901,7 +14901,15 @@ all_ins(PyObject *m)
1490114901
#ifdef O_ACCMODE
1490214902
if (PyModule_AddIntMacro(m, O_ACCMODE)) return -1;
1490314903
#endif
14904-
14904+
#ifdef O_EVTONLY
14905+
if (PyModule_AddIntMacro(m, O_EVTONLY)) return -1;
14906+
#endif
14907+
#ifdef O_FSYNC
14908+
if (PyModule_AddIntMacro(m, O_FSYNC)) return -1;
14909+
#endif
14910+
#ifdef O_SYMLINK
14911+
if (PyModule_AddIntMacro(m, O_SYMLINK)) return -1;
14912+
#endif
1490514913

1490614914
#ifdef SEEK_HOLE
1490714915
if (PyModule_AddIntMacro(m, SEEK_HOLE)) return -1;
@@ -14951,6 +14959,9 @@ all_ins(PyObject *m)
1495114959
/* Do not follow links. */
1495214960
if (PyModule_AddIntMacro(m, O_NOFOLLOW)) return -1;
1495314961
#endif
14962+
#ifdef O_NOFOLLOW_ANY
14963+
if (PyModule_AddIntMacro(m, O_NOFOLLOW_ANY)) return -1;
14964+
#endif
1495414965
#ifdef O_NOLINKS
1495514966
/* Fails if link count of the named file is greater than 1 */
1495614967
if (PyModule_AddIntMacro(m, O_NOLINKS)) return -1;

0 commit comments

Comments
 (0)