Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions stdlib/@tests/stubtest_allowlists/darwin-py311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ webbrowser.MacOSX.__init__
spwd
msilib(.[a-z]+)?
ossaudiodev

# Not present on all MacOS versions
fcntl.F_OFD_GETLK
fcntl.F_OFD_SETLK
fcntl.F_OFD_SETLKW
5 changes: 5 additions & 0 deletions stdlib/@tests/stubtest_allowlists/darwin-py312.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ curses.window.get_wch
spwd
msilib(.[a-z]+)?
ossaudiodev

# Not present on all MacOS versions
fcntl.F_OFD_GETLK
fcntl.F_OFD_SETLK
fcntl.F_OFD_SETLKW
6 changes: 0 additions & 6 deletions stdlib/@tests/stubtest_allowlists/darwin-py313.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
# new in py313
fcntl.F_GETNOSIGPIPE
fcntl.F_OFD_GETLK
fcntl.F_OFD_SETLK
fcntl.F_OFD_SETLKW
fcntl.F_RDAHEAD
fcntl.F_SETNOSIGPIPE
posixpath.splitroot

# Exists locally on MacOS but not on GitHub
Expand Down
19 changes: 16 additions & 3 deletions stdlib/fcntl.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ if sys.platform != "win32":
F_SEAL_SHRINK: int
F_SEAL_WRITE: int
if sys.version_info >= (3, 9):
F_OFD_GETLK: int
F_OFD_SETLK: int
F_OFD_SETLKW: int
F_OFD_GETLK: Final[int]
F_OFD_SETLK: Final[int]
F_OFD_SETLKW: Final[int]

if sys.version_info >= (3, 10):
F_GETPIPE_SZ: int
F_SETPIPE_SZ: int
Expand Down Expand Up @@ -123,6 +124,18 @@ if sys.platform != "win32":
RWH_WRITE_LIFE_LONG: Final = 4
RWH_WRITE_LIFE_EXTREME: Final = 5

if sys.version_info >= (3, 11) and sys.platform == "darwin":
F_OFD_SETLK: Final = 90
F_OFD_SETLKW: Final = 91
F_OFD_GETLK: Final = 92

if sys.version_info >= (3, 13) and sys.platform != "linux":
# OSx and NetBSD
F_GETNOSIGPIPE: Final[int]
F_SETNOSIGPIPE: Final[int]
# OSx and FreeBSD
F_RDAHEAD: Final[int]

@overload
def fcntl(fd: FileDescriptorLike, cmd: int, arg: int = 0, /) -> int: ...
@overload
Expand Down