Add os.eventfd, os.eventfd_read and os.eventfd_write to Linux for Python 3.10+ (#10768)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Amin Alaee
2023-09-25 15:10:56 +02:00
committed by GitHub
parent cec86eb22e
commit e69545844b
5 changed files with 21 additions and 19 deletions

View File

@@ -2,6 +2,7 @@ import sys
from _typeshed import (
AnyStr_co,
BytesPath,
FileDescriptor,
FileDescriptorLike,
FileDescriptorOrPath,
GenericPath,
@@ -1057,6 +1058,14 @@ if sys.version_info >= (3, 12) and sys.platform == "win32":
def listmounts(volume: str) -> list[str]: ...
def listvolumes() -> list[str]: ...
if sys.version_info >= (3, 10) and sys.platform == "linux":
EFD_CLOEXEC: int
EFD_NONBLOCK: int
EFD_SEMAPHORE: int
def eventfd(initval: int, flags: int = 524288) -> FileDescriptor: ...
def eventfd_read(fd: FileDescriptor) -> int: ...
def eventfd_write(fd: FileDescriptor, value: int) -> None: ...
if sys.version_info >= (3, 12) and sys.platform == "linux":
CLONE_FILES: int
CLONE_FS: int
@@ -1072,3 +1081,4 @@ if sys.version_info >= (3, 12) and sys.platform == "linux":
CLONE_SYSVSEM: int
CLONE_THREAD: int
CLONE_VM: int
def unshare(flags: int) -> None: ...