PageRenderTime 42ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/include/sys/unistd.h

http://www.minix3.org/
C++ Header | 208 lines | 82 code | 16 blank | 110 comment | 0 complexity | a8bef0a568f019b1eccd7e9a0d9e1330 MD5 | raw file
Possible License(s): MIT, WTFPL, AGPL-1.0, BSD-3-Clause, GPL-3.0, LGPL-2.0, JSON, 0BSD
  1. /* $NetBSD: unistd.h,v 1.52 2009/08/30 16:38:48 christos Exp $ */
  2. /*
  3. * Copyright (c) 1989, 1993
  4. * The Regents of the University of California. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. * 1. Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. * 2. Redistributions in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the distribution.
  14. * 3. Neither the name of the University nor the names of its contributors
  15. * may be used to endorse or promote products derived from this software
  16. * without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  19. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  20. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  21. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  22. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  23. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  24. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  25. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  26. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  27. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28. * SUCH DAMAGE.
  29. *
  30. * @(#)unistd.h 8.2 (Berkeley) 1/7/94
  31. */
  32. #ifndef _SYS_UNISTD_H_
  33. #define _SYS_UNISTD_H_
  34. #include <sys/featuretest.h>
  35. /* compile-time symbolic constants */
  36. #define _POSIX_JOB_CONTROL 1
  37. /* implementation supports job control */
  38. /*
  39. * According to POSIX 1003.1:
  40. * "The saved set-user-ID capability allows a program to regain the
  41. * effective user ID established at the last exec call."
  42. * However, the setuid/setgid function as specified by POSIX 1003.1 does
  43. * not allow changing the effective ID from the super-user without also
  44. * changed the saved ID, so it is impossible to get super-user privileges
  45. * back later. Instead we provide this feature independent of the current
  46. * effective ID through the seteuid/setegid function. In addition, we do
  47. * not use the saved ID as specified by POSIX 1003.1 in setuid/setgid,
  48. * because this would make it impossible for a set-user-ID executable
  49. * owned by a user other than the super-user to permanently revoke its
  50. * extra privileges.
  51. */
  52. #ifdef _NOT_AVAILABLE
  53. #define _POSIX_SAVED_IDS 1
  54. /* saved set-user-ID and set-group-ID */
  55. #endif
  56. #define _POSIX_VERSION 200112L
  57. #define _POSIX2_VERSION 200112L
  58. /* execution-time symbolic constants */
  59. /*
  60. * POSIX options and option groups we unconditionally do or don't
  61. * implement. Those options which are implemented (or not) entirely
  62. * in user mode are defined in <unistd.h>. Please keep this list in
  63. * alphabetical order.
  64. *
  65. * Anything which is defined as zero below **must** have an
  66. * implementation for the corresponding sysconf() which is able to
  67. * determine conclusively whether or not the feature is supported.
  68. * Anything which is defined as other than -1 below **must** have
  69. * complete headers, types, and function declarations as specified by
  70. * the POSIX standard; however, if the relevant sysconf() function
  71. * returns -1, the functions may be stubbed out.
  72. */
  73. /* Advisory information */
  74. #undef _POSIX_ADVISORY_INFO
  75. /* asynchronous I/O is available */
  76. #define _POSIX_ASYNCHRONOUS_IO 200112L
  77. /* barriers */
  78. #define _POSIX_BARRIERS 200112L
  79. /* chown requires correct privileges */
  80. #define _POSIX_CHOWN_RESTRICTED 1
  81. /* clock selection */
  82. #define _POSIX_CLOCK_SELECTION -1
  83. /* CPU type */
  84. #undef _POSIX_CPUTYPE
  85. /* file synchronization is available */
  86. #define _POSIX_FSYNC 1
  87. /* support IPv6 */
  88. #define _POSIX_IPV6 0
  89. /* job control is available */
  90. #define _POSIX_JOB_CONTROL 1
  91. /* memory mapped files */
  92. #define _POSIX_MAPPED_FILES 1
  93. /* memory locking whole address space */
  94. #define _POSIX_MEMLOCK 1
  95. /* memory locking address ranges */
  96. #define _POSIX_MEMLOCK_RANGE 1
  97. /* memory access protections */
  98. #define _POSIX_MEMORY_PROTECTION 1
  99. /* message passing is available */
  100. #define _POSIX_MESSAGE_PASSING 200112L
  101. /* monotonic clock */
  102. #define _POSIX_MONOTONIC_CLOCK 200112L
  103. /* too-long path comp generate errors */
  104. #define _POSIX_NO_TRUNC 1
  105. /* prioritized I/O */
  106. #define _POSIX_PRIORITIZED_IO -1
  107. /* priority scheduling */
  108. #define _POSIX_PRIORITY_SCHEDULING 200112L
  109. /* raw sockets */
  110. #define _POSIX_RAW_SOCKETS 200112L
  111. /* read/write locks */
  112. #define _POSIX_READER_WRITER_LOCKS 200112L
  113. /* realtime signals */
  114. #undef _POSIX_REALTIME_SIGNALS
  115. /* regular expressions */
  116. #define _POSIX_REGEXP 1
  117. /* semaphores */
  118. #define _POSIX_SEMAPHORES 0
  119. /* shared memory */
  120. #undef _POSIX_SHARED_MEMORY_OBJECTS
  121. /* shell */
  122. #define _POSIX_SHELL 1
  123. /* spin locks */
  124. #define _POSIX_SPIN_LOCKS 200112L
  125. /* sporadic server */
  126. #undef _POSIX_SPORADIC_SERVER
  127. /* synchronized I/O is available */
  128. #define _POSIX_SYNCHRONIZED_IO 1
  129. /* threads */
  130. #define _POSIX_THREADS 200112L
  131. /* pthread_attr for stack size */
  132. #define _POSIX_THREAD_ATTR_STACKSIZE 200112L
  133. /* pthread_attr for stack address */
  134. #define _POSIX_THREAD_ATTR_STACKADDR 200112L
  135. /* _r functions */
  136. #define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
  137. /* timeouts */
  138. #undef _POSIX_TIMEOUTS
  139. /* timers */
  140. #undef _POSIX_TIMERS
  141. /* typed memory objects */
  142. #undef _POSIX_TYPED_MEMORY_OBJECTS
  143. /* may disable terminal spec chars */
  144. #define _POSIX_VDISABLE __CAST(unsigned char, '\377')
  145. /* C binding */
  146. #define _POSIX2_C_BIND 200112L
  147. /* XPG4.2 shared memory */
  148. #define _XOPEN_SHM 0
  149. /* access function */
  150. #define F_OK 0 /* test for existence of file */
  151. #define X_OK 0x01 /* test for execute or search permission */
  152. #define W_OK 0x02 /* test for write permission */
  153. #define R_OK 0x04 /* test for read permission */
  154. /* whence values for lseek(2) */
  155. #define SEEK_SET 0 /* set file offset to offset */
  156. #define SEEK_CUR 1 /* set file offset to current plus offset */
  157. #define SEEK_END 2 /* set file offset to EOF plus offset */
  158. #if defined(_NETBSD_SOURCE)
  159. /* whence values for lseek(2); renamed by POSIX 1003.1 */
  160. #define L_SET SEEK_SET
  161. #define L_INCR SEEK_CUR
  162. #define L_XTND SEEK_END
  163. #endif
  164. /* configurable pathname variables; use as argument to pathconf(3) */
  165. #define _PC_LINK_MAX 1 /* link count */
  166. #define _PC_MAX_CANON 2 /* size of the canonical input queue */
  167. #define _PC_MAX_INPUT 3 /* type-ahead buffer size */
  168. #define _PC_NAME_MAX 4 /* file name size */
  169. #define _PC_PATH_MAX 5 /* pathname size */
  170. #define _PC_PIPE_BUF 6 /* pipe size */
  171. #define _PC_NO_TRUNC 7 /* treatment of long name components */
  172. #define _PC_VDISABLE 8 /* tty disable */
  173. #define _PC_CHOWN_RESTRICTED 9 /* chown restricted or not */
  174. /* configurable system variables; use as argument to sysconf(3) */
  175. /*
  176. * XXX The value of _SC_CLK_TCK is embedded in <time.h>.
  177. * XXX The value of _SC_PAGESIZE is embedded in <sys/shm.h>.
  178. */
  179. #define _SC_ARG_MAX 1
  180. #define _SC_CHILD_MAX 2
  181. #define _SC_CLOCKS_PER_SEC 3
  182. #define _SC_CLK_TCK 3
  183. #define _SC_NGROUPS_MAX 4
  184. #define _SC_OPEN_MAX 5
  185. #define _SC_JOB_CONTROL 6
  186. #define _SC_SAVED_IDS 7
  187. #define _SC_VERSION 8
  188. #define _SC_STREAM_MAX 9
  189. #define _SC_TZNAME_MAX 10
  190. #define _SC_PAGESIZE 11
  191. #define _SC_PAGE_SIZE _SC_PAGESIZE
  192. #endif /* !_SYS_UNISTD_H_ */