14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 * Copyright (c) 2013 Gary Mills
25 *
26 * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
27 */
28
29 /* Copyright (c) 1988 AT&T */
30 /* All Rights Reserved */
31
32 /* Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. */
33
34 #ifndef _UNISTD_H
35 #define _UNISTD_H
36
37 #include <sys/feature_tests.h>
38
39 #include <sys/types.h>
40 #include <sys/unistd.h>
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
46 /* Symbolic constants for the "access" routine: */
47 #define R_OK 4 /* Test for Read permission */
48 #define W_OK 2 /* Test for Write permission */
49 #define X_OK 1 /* Test for eXecute permission */
50 #define F_OK 0 /* Test for existence of File */
51
52 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
53 #define F_ULOCK 0 /* Unlock a previously locked region */
54 #define F_LOCK 1 /* Lock a region for exclusive use */
55 #define F_TLOCK 2 /* Test and lock a region for exclusive use */
56 #define F_TEST 3 /* Test a region for other processes locks */
57 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
58
161 #define _POSIX_SPAWN 200112L
162 #define _POSIX_SPIN_LOCKS 200112L
163 #define _POSIX_TIMEOUTS 200112L
164
165 /*
166 * Support for the POSIX.1 mutex protocol attribute. For realtime applications
167 * which need mutexes to support priority inheritance/ceiling.
168 */
169 #if defined(_XPG6)
170 #define _POSIX_THREAD_PRIO_INHERIT 200112L
171 #define _POSIX_THREAD_PRIO_PROTECT 200112L
172 #else
173 #define _POSIX_THREAD_PRIO_INHERIT 1
174 #define _POSIX_THREAD_PRIO_PROTECT 1
175 #endif
176
177 #ifndef _POSIX_VDISABLE
178 #define _POSIX_VDISABLE 0
179 #endif
180
181 #ifndef NULL
182 #if defined(_LP64)
183 #define NULL 0L
184 #else
185 #define NULL 0
186 #endif
187 #endif
188
189 #define STDIN_FILENO 0
190 #define STDOUT_FILENO 1
191 #define STDERR_FILENO 2
192
193 /*
194 * Large File Summit-related announcement macros. The system supports both
195 * the additional and transitional Large File Summit interfaces. (The final
196 * two macros provide a finer granularity breakdown of _LFS64_LARGEFILE.)
197 */
198 #define _LFS_LARGEFILE 1
199 #define _LFS64_LARGEFILE 1
200 #define _LFS64_STDIO 1
201 #define _LFS64_ASYNCHRONOUS_IO 1
202
203 /* large file compilation environment setup */
204 #if !defined(_LP64) && _FILE_OFFSET_BITS == 64
205 #ifdef __PRAGMA_REDEFINE_EXTNAME
206 #pragma redefine_extname ftruncate ftruncate64
207 #pragma redefine_extname lseek lseek64
208 #pragma redefine_extname pread pread64
|
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 * Copyright (c) 2013 Gary Mills
25 *
26 * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
27 */
28
29 /* Copyright (c) 1988 AT&T */
30 /* All Rights Reserved */
31
32 /* Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. */
33
34 /*
35 * Copyright 2014 PALO, Richard.
36 */
37
38 #ifndef _UNISTD_H
39 #define _UNISTD_H
40
41 #include <sys/feature_tests.h>
42
43 #include <sys/null.h>
44 #include <sys/types.h>
45 #include <sys/unistd.h>
46
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50
51 /* Symbolic constants for the "access" routine: */
52 #define R_OK 4 /* Test for Read permission */
53 #define W_OK 2 /* Test for Write permission */
54 #define X_OK 1 /* Test for eXecute permission */
55 #define F_OK 0 /* Test for existence of File */
56
57 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
58 #define F_ULOCK 0 /* Unlock a previously locked region */
59 #define F_LOCK 1 /* Lock a region for exclusive use */
60 #define F_TLOCK 2 /* Test and lock a region for exclusive use */
61 #define F_TEST 3 /* Test a region for other processes locks */
62 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
63
166 #define _POSIX_SPAWN 200112L
167 #define _POSIX_SPIN_LOCKS 200112L
168 #define _POSIX_TIMEOUTS 200112L
169
170 /*
171 * Support for the POSIX.1 mutex protocol attribute. For realtime applications
172 * which need mutexes to support priority inheritance/ceiling.
173 */
174 #if defined(_XPG6)
175 #define _POSIX_THREAD_PRIO_INHERIT 200112L
176 #define _POSIX_THREAD_PRIO_PROTECT 200112L
177 #else
178 #define _POSIX_THREAD_PRIO_INHERIT 1
179 #define _POSIX_THREAD_PRIO_PROTECT 1
180 #endif
181
182 #ifndef _POSIX_VDISABLE
183 #define _POSIX_VDISABLE 0
184 #endif
185
186 #define STDIN_FILENO 0
187 #define STDOUT_FILENO 1
188 #define STDERR_FILENO 2
189
190 /*
191 * Large File Summit-related announcement macros. The system supports both
192 * the additional and transitional Large File Summit interfaces. (The final
193 * two macros provide a finer granularity breakdown of _LFS64_LARGEFILE.)
194 */
195 #define _LFS_LARGEFILE 1
196 #define _LFS64_LARGEFILE 1
197 #define _LFS64_STDIO 1
198 #define _LFS64_ASYNCHRONOUS_IO 1
199
200 /* large file compilation environment setup */
201 #if !defined(_LP64) && _FILE_OFFSET_BITS == 64
202 #ifdef __PRAGMA_REDEFINE_EXTNAME
203 #pragma redefine_extname ftruncate ftruncate64
204 #pragma redefine_extname lseek lseek64
205 #pragma redefine_extname pread pread64
|