Skip to content

Commit 5d467a7

Browse files
authored
Add more constants and attributes to posix (#4552)
The constants were found by running dir(posix) on a Debian 10.5 (x86_64) system. Resolves #616.
1 parent 9a6b500 commit 5d467a7

File tree

1 file changed

+53
-5
lines changed

1 file changed

+53
-5
lines changed

stdlib/3/posix.pyi

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
# Stubs for posix
2-
3-
# NOTE: These are incomplete!
4-
51
import sys
62
from os import stat_result as stat_result
7-
from typing import List, NamedTuple, Optional, overload
3+
from typing import Any, Dict, List, NamedTuple, Optional, overload
84

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

32+
CLD_CONTINUED: int
33+
CLD_DUMPED: int
34+
CLD_EXITED: int
35+
CLD_TRAPPED: int
36+
3637
EX_CANTCREAT: int
3738
EX_CONFIG: int
3839
EX_DATAERR: int
@@ -56,6 +57,11 @@ R_OK: int
5657
W_OK: int
5758
X_OK: int
5859

60+
F_LOCK: int
61+
F_TEST: int
62+
F_TLOCK: int
63+
F_ULOCK: int
64+
5965
if sys.version_info >= (3, 6):
6066
GRND_NONBLOCK: int
6167
GRND_RANDOM: int
@@ -82,6 +88,39 @@ O_SYNC: int
8288
O_TRUNC: int
8389
O_WRONLY: int
8490

91+
POSIX_FADV_DONTNEED: int
92+
POSIX_FADV_NOREUSE: int
93+
POSIX_FADV_NORMAL: int
94+
POSIX_FADV_RANDOM: int
95+
POSIX_FADV_SEQUENTIAL: int
96+
POSIX_FADV_WILLNEED: int
97+
98+
PRIO_PGRP: int
99+
PRIO_PROCESS: int
100+
PRIO_USER: int
101+
102+
P_ALL: int
103+
P_PGID: int
104+
P_PID: int
105+
106+
RTLD_DEEPBIND: int
107+
RTLD_GLOBAL: int
108+
RTLD_LAZY: int
109+
RTLD_LOCAL: int
110+
RTLD_NODELETE: int
111+
RTLD_NOLOAD: int
112+
RTLD_NOW: int
113+
114+
SCHED_BATCH: int
115+
SCHED_FIFO: int
116+
SCHED_IDLE: int
117+
SCHED_OTHER: int
118+
SCHED_RESET_ON_FORK: int
119+
SCHED_RR: int
120+
121+
SEEK_DATA: int
122+
SEEK_HOLE: int
123+
85124
ST_APPEND: int
86125
ST_MANDLOCK: int
87126
ST_NOATIME: int
@@ -107,6 +146,10 @@ WSTOPSIG: int
107146
WTERMSIG: int
108147
WUNTRACED: int
109148

149+
XATTR_CREATE: int
150+
XATTR_REPLACE: int
151+
XATTR_SIZE_MAX: int
152+
110153
if sys.version_info >= (3, 6):
111154
@overload
112155
def listdir(path: Optional[str] = ...) -> List[str]: ...
@@ -124,3 +167,8 @@ else:
124167
def listdir(path: bytes) -> List[bytes]: ...
125168
@overload
126169
def listdir(path: int) -> List[str]: ...
170+
171+
if sys.platform == "win32":
172+
environ: Dict[str, str]
173+
else:
174+
environ: Dict[bytes, bytes]

0 commit comments

Comments
 (0)