mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-22 03:41:28 +08:00
Re-export more os functions in posix, tweak availability on linux (#6529)
This commit is contained in:
@@ -575,8 +575,6 @@ if sys.platform != "win32":
|
||||
# Unix only
|
||||
def fchmod(fd: int, mode: int) -> None: ...
|
||||
def fchown(fd: int, uid: int, gid: int) -> None: ...
|
||||
if sys.platform != "darwin":
|
||||
def fdatasync(fd: FileDescriptorLike) -> None: ... # Unix only, not Mac
|
||||
def fpathconf(__fd: int, __name: str | int) -> int: ...
|
||||
def fstatvfs(__fd: int) -> statvfs_result: ...
|
||||
def get_blocking(__fd: int) -> bool: ...
|
||||
@@ -584,7 +582,8 @@ if sys.platform != "win32":
|
||||
def lockf(__fd: int, __command: int, __length: int) -> None: ...
|
||||
def openpty() -> tuple[int, int]: ... # some flavors of Unix
|
||||
if sys.platform != "darwin":
|
||||
def pipe2(flags: int) -> tuple[int, int]: ... # some flavors of Unix
|
||||
def fdatasync(fd: FileDescriptorLike) -> None: ...
|
||||
def pipe2(__flags: int) -> tuple[int, int]: ... # some flavors of Unix
|
||||
def posix_fallocate(fd: int, offset: int, length: int) -> None: ...
|
||||
def posix_fadvise(fd: int, offset: int, length: int, advice: int) -> None: ...
|
||||
def pread(__fd: int, __length: int, __offset: int) -> bytes: ...
|
||||
@@ -632,17 +631,14 @@ def getcwd() -> str: ...
|
||||
def getcwdb() -> bytes: ...
|
||||
def chmod(path: _FdOrAnyPath, mode: int, *, dir_fd: int | None = ..., follow_symlinks: bool = ...) -> None: ...
|
||||
|
||||
if sys.platform != "win32":
|
||||
if sys.platform != "win32" and sys.platform != "linux":
|
||||
def chflags(path: StrOrBytesPath, flags: int, follow_symlinks: bool = ...) -> None: ... # some flavors of Unix
|
||||
def chown(
|
||||
path: _FdOrAnyPath, uid: int, gid: int, *, dir_fd: int | None = ..., follow_symlinks: bool = ...
|
||||
) -> None: ... # Unix only
|
||||
|
||||
if sys.platform != "win32":
|
||||
# Unix only
|
||||
def chroot(path: StrOrBytesPath) -> None: ...
|
||||
def lchflags(path: StrOrBytesPath, flags: int) -> None: ...
|
||||
def lchmod(path: StrOrBytesPath, mode: int) -> None: ...
|
||||
|
||||
if sys.platform != "win32":
|
||||
def chroot(path: StrOrBytesPath) -> None: ...
|
||||
def chown(path: _FdOrAnyPath, uid: int, gid: int, *, dir_fd: int | None = ..., follow_symlinks: bool = ...) -> None: ...
|
||||
def lchown(path: StrOrBytesPath, uid: int, gid: int) -> None: ...
|
||||
|
||||
def link(
|
||||
|
||||
@@ -103,6 +103,7 @@ if sys.platform != "win32":
|
||||
ctermid as ctermid,
|
||||
device_encoding as device_encoding,
|
||||
dup as dup,
|
||||
dup2 as dup2,
|
||||
error as error,
|
||||
execv as execv,
|
||||
execve as execve,
|
||||
@@ -212,6 +213,8 @@ if sys.platform != "win32":
|
||||
urandom as urandom,
|
||||
utime as utime,
|
||||
wait as wait,
|
||||
wait3 as wait3,
|
||||
wait4 as wait4,
|
||||
waitpid as waitpid,
|
||||
write as write,
|
||||
writev as writev,
|
||||
@@ -231,6 +234,9 @@ if sys.platform != "win32":
|
||||
removexattr as removexattr,
|
||||
setxattr as setxattr,
|
||||
)
|
||||
else:
|
||||
from os import chflags as chflags, lchflags as lchflags, lchmod as lchmod
|
||||
|
||||
if sys.platform != "darwin":
|
||||
from os import (
|
||||
POSIX_FADV_DONTNEED as POSIX_FADV_DONTNEED,
|
||||
@@ -242,6 +248,7 @@ if sys.platform != "win32":
|
||||
fdatasync as fdatasync,
|
||||
getresgid as getresgid,
|
||||
getresuid as getresuid,
|
||||
pipe2 as pipe2,
|
||||
posix_fadvise as posix_fadvise,
|
||||
posix_fallocate as posix_fallocate,
|
||||
sched_getaffinity as sched_getaffinity,
|
||||
|
||||
Reference in New Issue
Block a user