diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index 3f8b43849..b5013fcdc 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -1021,6 +1021,9 @@ if sys.version_info >= (3, 8): MFD_HUGE_2GB: int MFD_HUGE_16GB: int def memfd_create(name: str, flags: int = ...) -> int: ... + def copy_file_range( + src: int, dst: int, count: int, offset_src: int | None = ..., offset_dst: int | None = ... + ) -> int: ... if sys.version_info >= (3, 9): def waitstatus_to_exitcode(status: int) -> int: ... diff --git a/stdlib/posix.pyi b/stdlib/posix.pyi index b0b3fc4d2..5dba5b36e 100644 --- a/stdlib/posix.pyi +++ b/stdlib/posix.pyi @@ -303,6 +303,7 @@ if sys.platform != "win32": MFD_HUGE_MASK as MFD_HUGE_MASK, MFD_HUGE_SHIFT as MFD_HUGE_SHIFT, MFD_HUGETLB as MFD_HUGETLB, + copy_file_range as copy_file_range, memfd_create as memfd_create, ) if sys.version_info >= (3, 7): diff --git a/tests/stubtest_allowlists/linux-py310.txt b/tests/stubtest_allowlists/linux-py310.txt index 38ab16dc4..378acdecb 100644 --- a/tests/stubtest_allowlists/linux-py310.txt +++ b/tests/stubtest_allowlists/linux-py310.txt @@ -25,14 +25,12 @@ os.EFD_SEMAPHORE os.SPLICE_F_MORE os.SPLICE_F_MOVE os.SPLICE_F_NONBLOCK -os.copy_file_range os.eventfd os.eventfd_read os.eventfd_write os.splice posix.EFD_[A-Z]+ posix.SPLICE_[A-Z_]+ -posix.copy_file_range posix.eventfd posix.eventfd_read posix.eventfd_write diff --git a/tests/stubtest_allowlists/linux-py38.txt b/tests/stubtest_allowlists/linux-py38.txt index 639de17fc..2c835817c 100644 --- a/tests/stubtest_allowlists/linux-py38.txt +++ b/tests/stubtest_allowlists/linux-py38.txt @@ -1,5 +1 @@ select.epoll.register - -# Exists at runtime, but missing from stubs -os.copy_file_range -posix.copy_file_range diff --git a/tests/stubtest_allowlists/linux-py39.txt b/tests/stubtest_allowlists/linux-py39.txt index eb8a71b49..71f4eb92d 100644 --- a/tests/stubtest_allowlists/linux-py39.txt +++ b/tests/stubtest_allowlists/linux-py39.txt @@ -1,6 +1,2 @@ (os|posix).sendfile select.epoll.register - -# Exists at runtime, but missing from stubs -os.copy_file_range -posix.copy_file_range