OILS / pyext / posix_.pyi View on Github | oils.pub

213 lines, 200 significant
1# Copied from
2# /home/andy/.local/lib/python3.5/site-packages/mypy/typeshed/stdlib/2/posix.pyi
3
4from mycpp import mylib
5from typing import Dict, List, Mapping, Tuple, Union, Sequence, IO, Optional, TypeVar
6
7error = OSError
8
9confstr_names = ... # type: Dict[str, int]
10environ = ... # type: Dict[str, str]
11pathconf_names = ... # type: Dict[str, int]
12sysconf_names = ... # type: Dict[str, int]
13
14EX_CANTCREAT = ... # type: int
15EX_CONFIG = ... # type: int
16EX_DATAERR = ... # type: int
17EX_IOERR = ... # type: int
18EX_NOHOST = ... # type: int
19EX_NOINPUT = ... # type: int
20EX_NOPERM = ... # type: int
21EX_NOUSER = ... # type: int
22EX_OK = ... # type: int
23EX_OSERR = ... # type: int
24EX_OSFILE = ... # type: int
25EX_PROTOCOL = ... # type: int
26EX_SOFTWARE = ... # type: int
27EX_TEMPFAIL = ... # type: int
28EX_UNAVAILABLE = ... # type: int
29EX_USAGE = ... # type: int
30F_OK = ... # type: int
31NGROUPS_MAX = ... # type: int
32O_APPEND = ... # type: int
33O_ASYNC = ... # type: int
34O_CREAT = ... # type: int
35O_DIRECT = ... # type: int
36O_DIRECTORY = ... # type: int
37O_DSYNC = ... # type: int
38O_EXCL = ... # type: int
39O_LARGEFILE = ... # type: int
40O_NDELAY = ... # type: int
41O_NOATIME = ... # type: int
42O_NOCTTY = ... # type: int
43O_NOFOLLOW = ... # type: int
44O_NONBLOCK = ... # type: int
45O_RDONLY = ... # type: int
46O_RDWR = ... # type: int
47O_RSYNC = ... # type: int
48O_SYNC = ... # type: int
49O_TRUNC = ... # type: int
50O_WRONLY = ... # type: int
51R_OK = ... # type: int
52TMP_MAX = ... # type: int
53WCONTINUED = ... # type: int
54WNOHANG = ... # type: int
55WUNTRACED = ... # type: int
56W_OK = ... # type: int
57X_OK = ... # type: int
58
59# OILS patch
60F_DUPFD_CLOEXEC = ... # type: int
61
62def WCOREDUMP(status: int) -> int: ...
63def WEXITSTATUS(status: int) -> int: ...
64def WIFCONTINUED(status: int) -> bool: ...
65def WIFEXITED(status: int) -> bool: ...
66def WIFSIGNALED(status: int) -> bool: ...
67def WIFSTOPPED(status: int) -> bool: ...
68def WSTOPSIG(status: int) -> int: ...
69def WTERMSIG(status: int) -> int: ...
70
71class stat_result(object):
72 n_fields = ... # type: int
73 n_sequence_fields = ... # type: int
74 n_unnamed_fields = ... # type: int
75 st_mode = ... # type: int
76 st_ino = ... # type: int
77 st_dev = ... # type: int
78 st_nlink = ... # type: int
79 st_uid = ... # type: int
80 st_gid = ... # type: int
81 st_size = ... # type: int
82 st_atime = ... # type: int
83 st_mtime = ... # type: int
84 st_ctime = ... # type: int
85
86class statvfs_result(object):
87 n_fields = ... # type: int
88 n_sequence_fields = ... # type: int
89 n_unnamed_fields = ... # type: int
90 f_bsize = ... # type: int
91 f_frsize = ... # type: int
92 f_blocks = ... # type: int
93 f_bfree = ... # type: int
94 f_bavail = ... # type: int
95 f_files = ... # type: int
96 f_ffree = ... # type: int
97 f_favail = ... # type: int
98 f_flag = ... # type: int
99 f_namemax = ... # type: int
100
101def _exit(status: int) -> None: ...
102def abort() -> None: ...
103def access(path: unicode, mode: int) -> bool: ...
104def chdir(path: unicode) -> None: ...
105def chmod(path: unicode, mode: int) -> None: ...
106def chown(path: unicode, uid: int, gid: int) -> None: ...
107def chroot(path: unicode) -> None: ...
108def close(fd: int) -> None: ...
109def closerange(fd_low: int, fd_high: int) -> None: ...
110def confstr(name: Union[str, int]) -> str: ...
111def ctermid() -> str: ...
112def dup(fd: int) -> int: ...
113def dup2(fd: int, fd2: int) -> None: ...
114def execv(path: str, args: Sequence[str], env: Mapping[str, str]) -> None: ...
115def execve(path: str, args: Sequence[str], env: Mapping[str, str]) -> None: ...
116def fchdir(fd: int) -> None: ...
117def fchmod(fd: int, mode: int) -> None: ...
118def fchown(fd: int, uid: int, gid: int) -> None: ...
119def fdatasync(fd: int) -> None: ...
120
121def fdopen(fd: int, mode: str = ..., bufsize: int = ...) -> IO[str]: ...
122def fork() -> int:
123 raise OSError()
124def forkpty() -> Tuple[int, int]:
125 raise OSError()
126def fpathconf(fd: int, name: str) -> None: ...
127def fstat(fd: int) -> stat_result: ...
128def fstatvfs(fd: int) -> statvfs_result: ...
129def fsync(fd: int) -> None: ...
130def ftruncate(fd: int, length: int) -> None: ...
131def getcwd() -> str: ...
132def getcwdu() -> unicode: ...
133def getegid() -> int: ...
134def geteuid() -> int: ...
135def getgid() -> int: ...
136def getgroups() -> List[int]: ...
137def getloadavg() -> Tuple[float, float, float]:
138 raise OSError()
139def getlogin() -> str: ...
140def getpgid(pid: int) -> int: ...
141def getpgrp() -> int: ...
142def getpid() -> int: ...
143def getppid() -> int: ...
144def getresgid() -> Tuple[int, int, int]: ...
145def getresuid() -> Tuple[int, int, int]: ...
146def getsid(pid: int) -> int: ...
147def getuid() -> int: ...
148def initgroups(username: str, gid: int) -> None: ...
149def isatty(fd: int) -> bool: ...
150def kill(pid: int, sig: int) -> None: ...
151def killpg(pgid: int, sig: int) -> None: ...
152def lchown(path: unicode, uid: int, gid: int) -> None: ...
153def link(source: unicode, link_name: str) -> None: ...
154_T = TypeVar("_T")
155def listdir(path: _T) -> List[_T]: ...
156def lseek(fd: int, pos: int, how: int) -> None: ...
157def lstat(path: unicode) -> stat_result: ...
158def major(device: int) -> int: ...
159def makedev(major: int, minor: int) -> int: ...
160def minor(device: int) -> int: ...
161def mkdir(path: unicode, mode: int = ...) -> None: ...
162def mkfifo(path: unicode, mode: int = ...) -> None: ...
163def mknod(filename: unicode, mode: int = ..., device: int = ...) -> None: ...
164def nice(increment: int) -> int: ...
165def open(file: unicode, flags: int, mode: int = ...) -> int: ...
166def openpty() -> Tuple[int, int]: ...
167def pathconf(path: unicode, name: str) -> str: ...
168def pipe() -> Tuple[int, int]: ...
169def popen(command: str, mode: str = ..., bufsize: int = ...) -> IO[str]: ...
170def putenv(varname: str, value: str) -> None: ...
171def read(fd: int, n: int) -> str: ...
172def readlink(path: _T) -> _T: ...
173def remove(path: unicode) -> None: ...
174def rename(src: unicode, dst: unicode) -> None: ...
175def rmdir(path: unicode) -> None: ...
176def setegid(egid: int) -> None: ...
177def seteuid(euid: int) -> None: ...
178def setgid(gid: int) -> None: ...
179def setgroups(groups: Sequence[int]) -> None: ...
180def setpgid(pid: int, pgrp: int) -> None: ...
181def setpgrp() -> None: ...
182def setregid(rgid: int, egid: int) -> None: ...
183def setresgid(rgid: int, egid: int, sgid: int) -> None: ...
184def setresuid(ruid: int, euid: int, suid: int) -> None: ...
185def setreuid(ruid: int, euid: int) -> None: ...
186def setsid() -> None: ...
187def setuid(pid: int) -> None: ...
188def stat(path: unicode) -> stat_result: ...
189def statvfs(path: unicode) -> statvfs_result: ...
190def stat_float_times(fd: int) -> None: ...
191def strerror(code: int) -> str: ...
192def symlink(source: unicode, link_name: unicode) -> None: ...
193def sysconf(name: Union[str, int]) -> int: ...
194def system(command: unicode) -> int: ...
195def tcgetpgrp(fd: int) -> int: ...
196def tcsetpgrp(fd: int, pg: int) -> None: ...
197def times() -> Tuple[float, float, float, float, float]: ...
198def tmpfile() -> IO[str]: ...
199def ttyname(fd: int) -> str: ...
200def umask(mask: int) -> int: ...
201def uname() -> Tuple[str, str, str, str, str]: ...
202def unlink(path: unicode) -> None: ...
203def unsetenv(varname: str) -> None: ...
204def urandom(n: int) -> str: ...
205def utime(path: unicode, times: Optional[Tuple[int, int]]) -> None:
206 raise OSError
207def wait() -> int: ...
208_r = Tuple[float, float, int, int, int, int, int, int, int, int, int, int, int, int, int, int]
209def wait3(options: int) -> Tuple[int, int, _r]: ...
210def wait4(pid: int, options: int) -> Tuple[int, int, _r]: ...
211def waitpid(pid: int, options: int) -> Tuple[int, int]:
212 raise OSError()
213def write(fd: int, str: str) -> int: ...