Add os.unshare clone flags for Linux, Python 3.12+ (#10757)

This commit is contained in:
Amin Alaee
2023-09-24 17:23:30 +02:00
committed by GitHub
parent 8c4dd38840
commit 0a92429627
3 changed files with 38 additions and 13 deletions

View File

@@ -314,6 +314,24 @@ if sys.platform != "win32":
if sys.platform != "darwin":
from os import RWF_DSYNC as RWF_DSYNC, RWF_HIPRI as RWF_HIPRI, RWF_NOWAIT as RWF_NOWAIT, RWF_SYNC as RWF_SYNC
if sys.version_info >= (3, 12) and sys.platform == "linux":
from os import (
CLONE_FILES as CLONE_FILES,
CLONE_FS as CLONE_FS,
CLONE_NEWCGROUP as CLONE_NEWCGROUP,
CLONE_NEWIPC as CLONE_NEWIPC,
CLONE_NEWNET as CLONE_NEWNET,
CLONE_NEWNS as CLONE_NEWNS,
CLONE_NEWPID as CLONE_NEWPID,
CLONE_NEWTIME as CLONE_NEWTIME,
CLONE_NEWUSER as CLONE_NEWUSER,
CLONE_NEWUTS as CLONE_NEWUTS,
CLONE_SIGHAND as CLONE_SIGHAND,
CLONE_SYSVSEM as CLONE_SYSVSEM,
CLONE_THREAD as CLONE_THREAD,
CLONE_VM as CLONE_VM,
)
# Not same as os.environ or os.environb
# Because of this variable, we can't do "from posix import *" in os/__init__.pyi
environ: dict[bytes, bytes]