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