Re-export more os functions in posix, tweak availability on linux (#6529)

This commit is contained in:
Akuli
2021-12-07 17:10:41 +02:00
committed by GitHub
parent 14f2e0feb9
commit 7155bdae63
5 changed files with 14 additions and 25 deletions

View File

@@ -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(