add several re-exports to posix (#6495)

This commit is contained in:
Akuli
2021-12-05 18:45:24 +02:00
committed by GitHub
parent f43b968ab9
commit 7225dfafcf
14 changed files with 209 additions and 325 deletions

View File

@@ -87,10 +87,134 @@ if sys.platform != "win32":
WTERMSIG as WTERMSIG,
WUNTRACED as WUNTRACED,
X_OK as X_OK,
DirEntry as DirEntry,
_exit as _exit,
abort as abort,
access as access,
chdir as chdir,
chmod as chmod,
chown as chown,
chroot as chroot,
close as close,
closerange as closerange,
confstr as confstr,
confstr_names as confstr_names,
cpu_count as cpu_count,
ctermid as ctermid,
device_encoding as device_encoding,
dup as dup,
error as error,
execv as execv,
execve as execve,
fchdir as fchdir,
fchmod as fchmod,
fchown as fchown,
fork as fork,
forkpty as forkpty,
fpathconf as fpathconf,
fspath as fspath,
fstat as fstat,
fstatvfs as fstatvfs,
fsync as fsync,
ftruncate as ftruncate,
get_blocking as get_blocking,
get_inheritable as get_inheritable,
get_terminal_size as get_terminal_size,
getcwd as getcwd,
getcwdb as getcwdb,
getegid as getegid,
geteuid as geteuid,
getgid as getgid,
getgrouplist as getgrouplist,
getgroups as getgroups,
getloadavg as getloadavg,
getlogin as getlogin,
getpgid as getpgid,
getpgrp as getpgrp,
getpid as getpid,
getppid as getppid,
getpriority as getpriority,
getsid as getsid,
getuid as getuid,
initgroups as initgroups,
isatty as isatty,
kill as kill,
killpg as killpg,
lchown as lchown,
link as link,
listdir as listdir,
lockf as lockf,
lseek as lseek,
lstat as lstat,
major as major,
makedev as makedev,
minor as minor,
mkdir as mkdir,
mkfifo as mkfifo,
mknod as mknod,
nice as nice,
open as open,
openpty as openpty,
pathconf as pathconf,
pathconf_names as pathconf_names,
pipe as pipe,
pread as pread,
putenv as putenv,
pwrite as pwrite,
read as read,
readlink as readlink,
readv as readv,
remove as remove,
rename as rename,
replace as replace,
rmdir as rmdir,
scandir as scandir,
sched_get_priority_max as sched_get_priority_max,
sched_get_priority_min as sched_get_priority_min,
sched_param as sched_param,
sched_yield as sched_yield,
sendfile as sendfile,
set_blocking as set_blocking,
set_inheritable as set_inheritable,
setegid as setegid,
seteuid as seteuid,
setgid as setgid,
setgroups as setgroups,
setpgid as setpgid,
setpgrp as setpgrp,
setpriority as setpriority,
setregid as setregid,
setreuid as setreuid,
setsid as setsid,
setuid as setuid,
stat as stat,
stat_result as stat_result,
statvfs as statvfs,
statvfs_result as statvfs_result,
strerror as strerror,
symlink as symlink,
sync as sync,
sysconf as sysconf,
sysconf_names as sysconf_names,
system as system,
tcgetpgrp as tcgetpgrp,
tcsetpgrp as tcsetpgrp,
terminal_size as terminal_size,
times as times,
times_result as times_result,
truncate as truncate,
ttyname as ttyname,
umask as umask,
uname as uname,
uname_result as uname_result,
unlink as unlink,
unsetenv as unsetenv,
urandom as urandom,
utime as utime,
wait as wait,
waitpid as waitpid,
write as write,
writev as writev,
)
if sys.platform == "linux":
@@ -101,6 +225,11 @@ if sys.platform != "win32":
XATTR_CREATE as XATTR_CREATE,
XATTR_REPLACE as XATTR_REPLACE,
XATTR_SIZE_MAX as XATTR_SIZE_MAX,
getrandom as getrandom,
getxattr as getxattr,
listxattr as listxattr,
removexattr as removexattr,
setxattr as setxattr,
)
if sys.platform != "darwin":
from os import (
@@ -110,11 +239,53 @@ if sys.platform != "win32":
POSIX_FADV_RANDOM as POSIX_FADV_RANDOM,
POSIX_FADV_SEQUENTIAL as POSIX_FADV_SEQUENTIAL,
POSIX_FADV_WILLNEED as POSIX_FADV_WILLNEED,
fdatasync as fdatasync,
getresgid as getresgid,
getresuid as getresuid,
posix_fadvise as posix_fadvise,
posix_fallocate as posix_fallocate,
sched_getaffinity as sched_getaffinity,
sched_getparam as sched_getparam,
sched_getscheduler as sched_getscheduler,
sched_rr_get_interval as sched_rr_get_interval,
sched_setaffinity as sched_setaffinity,
sched_setparam as sched_setparam,
sched_setscheduler as sched_setscheduler,
setresgid as setresgid,
setresuid as setresuid,
waitid as waitid,
waitid_result as waitid_result,
)
if sys.version_info >= (3, 9):
from os import waitstatus_to_exitcode as waitstatus_to_exitcode
if sys.version_info >= (3, 8):
from os import posix_spawn as posix_spawn, posix_spawnp as posix_spawnp
if sys.platform == "linux":
from os import (
MFD_ALLOW_SEALING as MFD_ALLOW_SEALING,
MFD_CLOEXEC as MFD_CLOEXEC,
MFD_HUGE_1GB as MFD_HUGE_1GB,
MFD_HUGE_1MB as MFD_HUGE_1MB,
MFD_HUGE_2GB as MFD_HUGE_2GB,
MFD_HUGE_2MB as MFD_HUGE_2MB,
MFD_HUGE_8MB as MFD_HUGE_8MB,
MFD_HUGE_16GB as MFD_HUGE_16GB,
MFD_HUGE_16MB as MFD_HUGE_16MB,
MFD_HUGE_32MB as MFD_HUGE_32MB,
MFD_HUGE_64KB as MFD_HUGE_64KB,
MFD_HUGE_256MB as MFD_HUGE_256MB,
MFD_HUGE_512KB as MFD_HUGE_512KB,
MFD_HUGE_512MB as MFD_HUGE_512MB,
MFD_HUGE_MASK as MFD_HUGE_MASK,
MFD_HUGE_SHIFT as MFD_HUGE_SHIFT,
MFD_HUGETLB as MFD_HUGETLB,
memfd_create as memfd_create,
)
if sys.version_info >= (3, 7):
from os import register_at_fork as register_at_fork
# 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]