Skip to content

Add more constants and attributes to posix #4552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 53 additions & 5 deletions stdlib/3/posix.pyi
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Stubs for posix

# NOTE: These are incomplete!

import sys
from os import stat_result as stat_result
from typing import List, NamedTuple, Optional, overload
from typing import Any, Dict, List, NamedTuple, Optional, overload

if sys.version_info >= (3, 6):
from builtins import _PathLike # See comment in builtins
Expand Down Expand Up @@ -33,6 +29,11 @@ class waitid_result(NamedTuple):
class sched_param(NamedTuple):
sched_priority: int

CLD_CONTINUED: int
CLD_DUMPED: int
CLD_EXITED: int
CLD_TRAPPED: int

EX_CANTCREAT: int
EX_CONFIG: int
EX_DATAERR: int
Expand All @@ -56,6 +57,11 @@ R_OK: int
W_OK: int
X_OK: int

F_LOCK: int
F_TEST: int
F_TLOCK: int
F_ULOCK: int

if sys.version_info >= (3, 6):
GRND_NONBLOCK: int
GRND_RANDOM: int
Expand All @@ -82,6 +88,39 @@ O_SYNC: int
O_TRUNC: int
O_WRONLY: int

POSIX_FADV_DONTNEED: int
POSIX_FADV_NOREUSE: int
POSIX_FADV_NORMAL: int
POSIX_FADV_RANDOM: int
POSIX_FADV_SEQUENTIAL: int
POSIX_FADV_WILLNEED: int

PRIO_PGRP: int
PRIO_PROCESS: int
PRIO_USER: int

P_ALL: int
P_PGID: int
P_PID: int

RTLD_DEEPBIND: int
RTLD_GLOBAL: int
RTLD_LAZY: int
RTLD_LOCAL: int
RTLD_NODELETE: int
RTLD_NOLOAD: int
RTLD_NOW: int

SCHED_BATCH: int
SCHED_FIFO: int
SCHED_IDLE: int
SCHED_OTHER: int
SCHED_RESET_ON_FORK: int
SCHED_RR: int

SEEK_DATA: int
SEEK_HOLE: int

ST_APPEND: int
ST_MANDLOCK: int
ST_NOATIME: int
Expand All @@ -107,6 +146,10 @@ WSTOPSIG: int
WTERMSIG: int
WUNTRACED: int

XATTR_CREATE: int
XATTR_REPLACE: int
XATTR_SIZE_MAX: int

if sys.version_info >= (3, 6):
@overload
def listdir(path: Optional[str] = ...) -> List[str]: ...
Expand All @@ -124,3 +167,8 @@ else:
def listdir(path: bytes) -> List[bytes]: ...
@overload
def listdir(path: int) -> List[str]: ...

if sys.platform == "win32":
environ: Dict[str, str]
else:
environ: Dict[bytes, bytes]