1 /* $OpenBSD: unistd.h,v 1.13 2005/12/13 00:35:24 millert Exp $ */
2 /* $NetBSD: unistd.h,v 1.10 1994/06/29 06:46:06 cgd Exp $ */
3
4 /*
5 * Copyright (c) 1989, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the University nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * @(#)unistd.h 8.2 (Berkeley) 1/7/94
33 */
34
35 #ifndef _SYS_UNISTD_H_
36 #define _SYS_UNISTD_H_
37
38 #include <sys/cdefs.h>
39
40 /* compile-time symbolic constants */
41 #define _POSIX_JOB_CONTROL /* implementation supports job control */
42
43 #define _POSIX_SAVED_IDS /* saved set-user-ID and set-group-ID */
44
45 #define _POSIX_VERSION 199009L
46 #define _POSIX2_VERSION 199212L
47
48 /* execution-time symbolic constants */
49 /* chown requires appropriate privileges */
50 #define _POSIX_CHOWN_RESTRICTED 1
51 /* too-long path components generate errors */
52 #define _POSIX_NO_TRUNC 1
53 /* may disable terminal special characters */
54 #define _POSIX_VDISABLE (0377)
55 /* file synchronization is available */
56 #define _POSIX_FSYNC 1
57
58 /* access function */
59 #define F_OK 0 /* test for existence of file */
60 #define X_OK 0x01 /* test for execute or search permission */
61 #define W_OK 0x02 /* test for write permission */
62 #define R_OK 0x04 /* test for read permission */
63
64 /* whence values for lseek(2) */
65 #define SEEK_SET 0 /* set file offset to offset */
66 #define SEEK_CUR 1 /* set file offset to current plus offset */
67 #define SEEK_END 2 /* set file offset to EOF plus offset */
68
69 #if __BSD_VISIBLE
70 /* old BSD whence values for lseek(2); renamed by POSIX 1003.1 */
71 #define L_SET SEEK_SET
72 #define L_INCR SEEK_CUR
73 #define L_XTND SEEK_END
74 #endif
75
76 /* configurable pathname variables */
77 #define _PC_LINK_MAX 1
78 #define _PC_MAX_CANON 2
79 #define _PC_MAX_INPUT 3
80 #define _PC_NAME_MAX 4
81 #define _PC_PATH_MAX 5
82 #define _PC_PIPE_BUF 6
83 #define _PC_CHOWN_RESTRICTED 7
84 #define _PC_NO_TRUNC 8
85 #define _PC_VDISABLE 9
86
87 /* configurable system variables */
88 #define _SC_ARG_MAX 1
89 #define _SC_CHILD_MAX 2
90 #define _SC_CLK_TCK 3
91 #define _SC_NGROUPS_MAX 4
92 #define _SC_OPEN_MAX 5
93 #define _SC_JOB_CONTROL 6
94 #define _SC_SAVED_IDS 7
95 #define _SC_VERSION 8
96 #define _SC_BC_BASE_MAX 9
97 #define _SC_BC_DIM_MAX 10
98 #define _SC_BC_SCALE_MAX 11
99 #define _SC_BC_STRING_MAX 12
100 #define _SC_COLL_WEIGHTS_MAX 13
101 #define _SC_EXPR_NEST_MAX 14
102 #define _SC_LINE_MAX 15
103 #define _SC_RE_DUP_MAX 16
104 #define _SC_2_VERSION 17
105 #define _SC_2_C_BIND 18
106 #define _SC_2_C_DEV 19
107 #define _SC_2_CHAR_TERM 20
108 #define _SC_2_FORT_DEV 21
109 #define _SC_2_FORT_RUN 22
110 #define _SC_2_LOCALEDEF 23
111 #define _SC_2_SW_DEV 24
112 #define _SC_2_UPE 25
113 #define _SC_STREAM_MAX 26
114 #define _SC_TZNAME_MAX 27
115 #define _SC_PAGESIZE 28
116 #define _SC_PAGE_SIZE _SC_PAGESIZE /* 1170 compatibility */
117 #define _SC_FSYNC 29
118 #define _SC_XOPEN_SHM 30
119 #define _SC_SEM_NSEMS_MAX 31
120 #define _SC_SEM_VALUE_MAX 32
121
122 #ifdef notyet
123 /* P1003.1c */
124 #define _SC_GETGR_R_SIZE_MAX
125 #define _SC_GETPW_R_SIZE_MAX
126 #define _SC_LOGIN_NAME_MAX
127 #define _SC_THREAD_DESTRUCTOR_ITERATIONS
128 #define _SC_THREAD_KEYS_MAX
129 #define _SC_THREAD_STACK_MIN
130 #define _SC_THREAD_THREADS_MAX
131 #define _SC_TTY_NAME_MAX
132 #define _SC_THREADS
133 #define _SC_THREAD_ATTR_STACKADDR
134 #define _SC_THREAD_ATTR_STACKSIZE
135 #define _SC_THREAD_PRIORITY_SCHEDULING
136 #define _SC_THREAD_PRIO_INHERIT
137 #define _SC_THREAD_PRIO_PROTECT
138 #define _SC_THREAD_PROCESS_SHARED
139 #define _SC_THREAD_SAFE_FUNCTIONS
140 #endif
141
142 /* configurable system strings */
143 #define _CS_PATH 1
144
145 #endif /* !_SYS_UNISTD_H_ */