gh-97897: Prevent os.mkfifo and os.mknod segfaults with macOS 13 SDK … · python/cpython@6d0a019 · GitHub
Skip to content

Commit 6d0a019

Browse files
authored
gh-97897: Prevent os.mkfifo and os.mknod segfaults with macOS 13 SDK (GH-97944)
The macOS 13 SDK includes support for the `mkfifoat` and `mknodat` system calls. Using the `dir_fd` option with either `os.mkfifo` or `os.mknod` could result in a segfault if cpython is built with the macOS 13 SDK but run on an earlier version of macOS. Prevent this by adding runtime support for detection of these system calls ("weaklinking") as is done for other newer syscalls on macOS.
1 parent e63d7da commit 6d0a019

3 files changed

Lines changed: 80 additions & 8 deletions

File tree

Lib/test/test_posix.py

Lines changed: 22 additions & 0 deletions
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
The macOS 13 SDK includes support for the ``mkfifoat`` and ``mknodat`` system calls.
2+
Using the ``dir_fd`` option with either :func:`os.mkfifo` or :func:`os.mknod` could result in a
3+
segfault if cpython is built with the macOS 13 SDK but run on an earlier
4+
version of macOS. Prevent this by adding runtime support for detection of
5+
these system calls ("weaklinking") as is done for other newer syscalls on
6+
macOS.

Modules/posixmodule.c

Lines changed: 52 additions & 8 deletions

0 commit comments

Comments
 (0)