unistd.pxd 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. # http://www.opengroup.org/onlinepubs/009695399/basedefs/unistd.h.html
  2. from posix.types cimport gid_t, pid_t, off_t, uid_t
  3. cdef extern from "<unistd.h>" nogil:
  4. #:NULL
  5. enum: R_OK
  6. enum: W_OK
  7. enum: X_OK
  8. enum: F_OK
  9. enum: _CS_PATH
  10. enum: _CS_POSIX_V6_ILP32_OFF32_CFLAGS
  11. enum: _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
  12. enum: _CS_POSIX_V6_ILP32_OFF32_LIBS
  13. enum: _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
  14. enum: _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
  15. enum: _CS_POSIX_V6_ILP32_OFFBIG_LIBS
  16. enum: _CS_POSIX_V6_LP64_OFF64_CFLAGS
  17. enum: _CS_POSIX_V6_LP64_OFF64_LDFLAGS
  18. enum: _CS_POSIX_V6_LP64_OFF64_LIBS
  19. enum: _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
  20. enum: _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
  21. enum: _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
  22. enum: _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS
  23. enum: SEEK_SET
  24. enum: SEEK_CUR
  25. enum: SEEK_END
  26. enum: F_LOCK
  27. enum: F_TEST
  28. enum: F_TLOCK
  29. enum: F_ULOCK
  30. enum: _PC_2_SYMLINKS
  31. enum: _PC_ALLOC_SIZE_MIN
  32. enum: _PC_ASYNC_IO
  33. enum: _PC_CHOWN_RESTRICTED
  34. enum: _PC_FILESIZEBITS
  35. enum: _PC_LINK_MAX
  36. enum: _PC_MAX_CANON
  37. enum: _PC_MAX_INPUT
  38. enum: _PC_NAME_MAX
  39. enum: _PC_NO_TRUNC
  40. enum: _PC_PATH_MAX
  41. enum: _PC_PIPE_BUF
  42. enum: _PC_PRIO_IO
  43. enum: _PC_REC_INCR_XFER_SIZE
  44. enum: _PC_REC_MIN_XFER_SIZE
  45. enum: _PC_REC_XFER_ALIGN
  46. enum: _PC_SYMLINK_MAX
  47. enum: _PC_SYNC_IO
  48. enum: _PC_VDISABLE
  49. enum: _SC_2_C_BIND
  50. enum: _SC_2_C_DEV
  51. enum: _SC_2_CHAR_TERM
  52. enum: _SC_2_FORT_DEV
  53. enum: _SC_2_FORT_RUN
  54. enum: _SC_2_LOCALEDEF
  55. enum: _SC_2_PBS
  56. enum: _SC_2_PBS_ACCOUNTING
  57. enum: _SC_2_PBS_CHECKPOINT
  58. enum: _SC_2_PBS_LOCATE
  59. enum: _SC_2_PBS_MESSAGE
  60. enum: _SC_2_PBS_TRACK
  61. enum: _SC_2_SW_DEV
  62. enum: _SC_2_UPE
  63. enum: _SC_2_VERSION
  64. enum: _SC_ADVISORY_INFO
  65. enum: _SC_AIO_LISTIO_MAX
  66. enum: _SC_AIO_MAX
  67. enum: _SC_AIO_PRIO_DELTA_MAX
  68. enum: _SC_ARG_MAX
  69. enum: _SC_ASYNCHRONOUS_IO
  70. enum: _SC_ATEXIT_MAX
  71. enum: _SC_BARRIERS
  72. enum: _SC_BC_BASE_MAX
  73. enum: _SC_BC_DIM_MAX
  74. enum: _SC_BC_SCALE_MAX
  75. enum: _SC_BC_STRING_MAX
  76. enum: _SC_CHILD_MAX
  77. enum: _SC_CLK_TCK
  78. enum: _SC_CLOCK_SELECTION
  79. enum: _SC_COLL_WEIGHTS_MAX
  80. enum: _SC_CPUTIME
  81. enum: _SC_DELAYTIMER_MAX
  82. enum: _SC_EXPR_NEST_MAX
  83. enum: _SC_FSYNC
  84. enum: _SC_GETGR_R_SIZE_MAX
  85. enum: _SC_GETPW_R_SIZE_MAX
  86. enum: _SC_HOST_NAME_MAX
  87. enum: _SC_IOV_MAX
  88. enum: _SC_IPV6
  89. enum: _SC_JOB_CONTROL
  90. enum: _SC_LINE_MAX
  91. enum: _SC_LOGIN_NAME_MAX
  92. enum: _SC_MAPPED_FILES
  93. enum: _SC_MEMLOCK
  94. enum: _SC_MEMLOCK_RANGE
  95. enum: _SC_MEMORY_PROTECTION
  96. enum: _SC_MESSAGE_PASSING
  97. enum: _SC_MONOTONIC_CLOCK
  98. enum: _SC_MQ_OPEN_MAX
  99. enum: _SC_MQ_PRIO_MAX
  100. enum: _SC_NGROUPS_MAX
  101. enum: _SC_OPEN_MAX
  102. enum: _SC_PAGE_SIZE
  103. enum: _SC_PAGESIZE
  104. enum: _SC_PRIORITIZED_IO
  105. enum: _SC_PRIORITY_SCHEDULING
  106. enum: _SC_RAW_SOCKETS
  107. enum: _SC_RE_DUP_MAX
  108. enum: _SC_READER_WRITER_LOCKS
  109. enum: _SC_REALTIME_SIGNALS
  110. enum: _SC_REGEXP
  111. enum: _SC_RTSIG_MAX
  112. enum: _SC_SAVED_IDS
  113. enum: _SC_SEM_NSEMS_MAX
  114. enum: _SC_SEM_VALUE_MAX
  115. enum: _SC_SEMAPHORES
  116. enum: _SC_SHARED_MEMORY_OBJECTS
  117. enum: _SC_SHELL
  118. enum: _SC_SIGQUEUE_MAX
  119. enum: _SC_SPAWN
  120. enum: _SC_SPIN_LOCKS
  121. enum: _SC_SPORADIC_SERVER
  122. enum: _SC_SS_REPL_MAX
  123. enum: _SC_STREAM_MAX
  124. enum: _SC_SYMLOOP_MAX
  125. enum: _SC_SYNCHRONIZED_IO
  126. enum: _SC_THREAD_ATTR_STACKADDR
  127. enum: _SC_THREAD_ATTR_STACKSIZE
  128. enum: _SC_THREAD_CPUTIME
  129. enum: _SC_THREAD_DESTRUCTOR_ITERATIONS
  130. enum: _SC_THREAD_KEYS_MAX
  131. enum: _SC_THREAD_PRIO_INHERIT
  132. enum: _SC_THREAD_PRIO_PROTECT
  133. enum: _SC_THREAD_PRIORITY_SCHEDULING
  134. enum: _SC_THREAD_PROCESS_SHARED
  135. enum: _SC_THREAD_SAFE_FUNCTIONS
  136. enum: _SC_THREAD_SPORADIC_SERVER
  137. enum: _SC_THREAD_STACK_MIN
  138. enum: _SC_THREAD_THREADS_MAX
  139. enum: _SC_THREADS
  140. enum: _SC_TIMEOUTS
  141. enum: _SC_TIMER_MAX
  142. enum: _SC_TIMERS
  143. enum: _SC_TRACE
  144. enum: _SC_TRACE_EVENT_FILTER
  145. enum: _SC_TRACE_EVENT_NAME_MAX
  146. enum: _SC_TRACE_INHERIT
  147. enum: _SC_TRACE_LOG
  148. enum: _SC_TRACE_NAME_MAX
  149. enum: _SC_TRACE_SYS_MAX
  150. enum: _SC_TRACE_USER_EVENT_MAX
  151. enum: _SC_TTY_NAME_MAX
  152. enum: _SC_TYPED_MEMORY_OBJECTS
  153. enum: _SC_TZNAME_MAX
  154. enum: _SC_V6_ILP32_OFF32
  155. enum: _SC_V6_ILP32_OFFBIG
  156. enum: _SC_V6_LP64_OFF64
  157. enum: _SC_V6_LPBIG_OFFBIG
  158. enum: _SC_VERSION
  159. enum: _SC_XBS5_ILP32_OFF32
  160. enum: _SC_XBS5_ILP32_OFFBIG
  161. enum: _SC_XBS5_LP64_OFF64
  162. enum: _SC_XBS5_LPBIG_OFFBIG
  163. enum: _SC_XOPEN_CRYPT
  164. enum: _SC_XOPEN_ENH_I18N
  165. enum: _SC_XOPEN_LEGACY
  166. enum: _SC_XOPEN_REALTIME
  167. enum: _SC_XOPEN_REALTIME_THREADS
  168. enum: _SC_XOPEN_SHM
  169. enum: _SC_XOPEN_STREAMS
  170. enum: _SC_XOPEN_UNIX
  171. enum: _SC_XOPEN_VERSION
  172. enum: STDIN_FILENO #0
  173. enum: STDOUT_FILENO #1
  174. enum: STDERR_FILENO #2
  175. ctypedef unsigned useconds_t
  176. int access(const char *, int)
  177. unsigned alarm(unsigned)
  178. int chdir(const char *)
  179. int chown(const char *, uid_t, gid_t)
  180. int close(int)
  181. size_t confstr(int, char *, size_t)
  182. char *crypt(const char *, const char *)
  183. char *ctermid(char *)
  184. int dup(int)
  185. int dup2(int, int)
  186. void encrypt(char[64], int)
  187. int execl(const char *, const char *, ...)
  188. int execle(const char *, const char *, ...)
  189. int execlp(const char *, const char *, ...)
  190. int execv(const char *, char *[])
  191. int execve(const char *, char *[], char *[])
  192. int execvp(const char *, char *[])
  193. void _exit(int)
  194. int fchown(int, uid_t, gid_t)
  195. int fchdir(int)
  196. int fdatasync(int)
  197. pid_t fork()
  198. long fpathconf(int, int)
  199. int fsync(int)
  200. int ftruncate(int, off_t)
  201. char *getcwd(char *, size_t)
  202. gid_t getegid()
  203. uid_t geteuid()
  204. gid_t getgid()
  205. int getgroups(int, gid_t [])
  206. long gethostid()
  207. int gethostname(char *, size_t)
  208. char *getlogin()
  209. int getlogin_r(char *, size_t)
  210. int getopt(int, char * [], const char *)
  211. pid_t getpgid(pid_t)
  212. pid_t getpgrp()
  213. pid_t getpid()
  214. pid_t getppid()
  215. pid_t getsid(pid_t)
  216. uid_t getuid()
  217. char *getwd(char *)
  218. int isatty(int)
  219. int lchown(const char *, uid_t, gid_t)
  220. int link(const char *, const char *)
  221. int lockf(int, int, off_t)
  222. off_t lseek(int, off_t, int)
  223. int nice(int)
  224. long pathconf(char *, int)
  225. int pause()
  226. int pipe(int [2])
  227. ssize_t pread(int, void *, size_t, off_t)
  228. ssize_t pwrite(int, const void *, size_t, off_t)
  229. ssize_t read(int, void *, size_t)
  230. ssize_t readlink(const char *, char *, size_t)
  231. int rmdir(const char *)
  232. int setegid(gid_t)
  233. int seteuid(uid_t)
  234. int setgid(gid_t)
  235. int setpgid(pid_t, pid_t)
  236. pid_t setpgrp()
  237. int setregid(gid_t, gid_t)
  238. int setreuid(uid_t, uid_t)
  239. pid_t setsid()
  240. int setuid(uid_t)
  241. unsigned sleep(unsigned)
  242. void swab(const void *, void *, ssize_t)
  243. int symlink(const char *, const char *)
  244. void sync()
  245. long sysconf(int)
  246. pid_t tcgetpgrp(int)
  247. int tcsetpgrp(int, pid_t)
  248. int truncate(const char *, off_t)
  249. char *ttyname(int)
  250. int ttyname_r(int, char *, size_t)
  251. useconds_t ualarm(useconds_t, useconds_t)
  252. int unlink(const char *)
  253. int usleep(useconds_t)
  254. pid_t vfork()
  255. ssize_t write(int, const void *, size_t)
  256. char *optarg
  257. int optind
  258. int opterr
  259. int optopt