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

@@ -236,6 +236,16 @@ if sys.platform != "win32":
removexattr as removexattr,
setxattr as setxattr,
)
if sys.version_info >= (3, 10):
from os import (
EFD_CLOEXEC as EFD_CLOEXEC,
EFD_NONBLOCK as EFD_NONBLOCK,
EFD_SEMAPHORE as EFD_SEMAPHORE,
eventfd as eventfd,
eventfd_read as eventfd_read,
eventfd_write as eventfd_write,
)
else:
from os import chflags as chflags, lchflags as lchflags, lchmod as lchmod
@@ -330,6 +340,7 @@ if sys.platform != "win32":
CLONE_SYSVSEM as CLONE_SYSVSEM,
CLONE_THREAD as CLONE_THREAD,
CLONE_VM as CLONE_VM,
unshare as unshare,
)
# Not same as os.environ or os.environb