mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-28 06:36:54 +08:00
Add os.unshare clone flags for Linux, Python 3.12+ (#10757)
This commit is contained in:
@@ -1056,3 +1056,19 @@ if sys.version_info >= (3, 12) and sys.platform == "win32":
|
||||
def listdrives() -> list[str]: ...
|
||||
def listmounts(volume: str) -> list[str]: ...
|
||||
def listvolumes() -> list[str]: ...
|
||||
|
||||
if sys.version_info >= (3, 12) and sys.platform == "linux":
|
||||
CLONE_FILES: int
|
||||
CLONE_FS: int
|
||||
CLONE_NEWCGROUP: int
|
||||
CLONE_NEWIPC: int
|
||||
CLONE_NEWNET: int
|
||||
CLONE_NEWNS: int
|
||||
CLONE_NEWPID: int
|
||||
CLONE_NEWTIME: int
|
||||
CLONE_NEWUSER: int
|
||||
CLONE_NEWUTS: int
|
||||
CLONE_SIGHAND: int
|
||||
CLONE_SYSVSEM: int
|
||||
CLONE_THREAD: int
|
||||
CLONE_VM: int
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
_?curses.color_pair
|
||||
_posixsubprocess.fork_exec
|
||||
(os|posix).CLONE_FILES
|
||||
(os|posix).CLONE_FS
|
||||
(os|posix).CLONE_NEWCGROUP
|
||||
(os|posix).CLONE_NEWIPC
|
||||
(os|posix).CLONE_NEWNET
|
||||
(os|posix).CLONE_NEWNS
|
||||
(os|posix).CLONE_NEWPID
|
||||
(os|posix).CLONE_NEWUSER
|
||||
(os|posix).CLONE_NEWUTS
|
||||
(os|posix).CLONE_SIGHAND
|
||||
(os|posix).CLONE_SYSVSEM
|
||||
(os|posix).CLONE_THREAD
|
||||
(os|posix).CLONE_VM
|
||||
(os|posix).EFD_CLOEXEC
|
||||
(os|posix).EFD_NONBLOCK
|
||||
(os|posix).EFD_SEMAPHORE
|
||||
@@ -40,3 +27,7 @@ tty.__all__
|
||||
tty.cfmakecbreak
|
||||
tty.cfmakeraw
|
||||
xxlimited.Xxo.x_exports
|
||||
|
||||
# Exists on some Linux builds, and is documented,
|
||||
# but is unavailable in Github Actions on Linux with Python 3.12
|
||||
(os|posix).CLONE_NEWTIME
|
||||
|
||||
Reference in New Issue
Block a user