]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/sys/unistd.h
xnu-792.17.14.tar.gz
[apple/xnu.git] / bsd / sys / unistd.h
index 00199aa57d8516fc27d95feb8194089f6df9bbaa..86f89685c1a5899bbe85373038086a5aa2f45ade 100644 (file)
@@ -1,16 +1,19 @@
 /*
  * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
  *
- * @APPLE_LICENSE_HEADER_START@
- * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ * 
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
  * 
  * The Original Code and all software distributed under the License are
  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
@@ -20,7 +23,7 @@
  * Please see the License for the specific language governing rights and
  * limitations under the License.
  * 
- * @APPLE_LICENSE_HEADER_END@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
  */
 /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */
 /*
@@ -61,9 +64,6 @@
 #ifndef _SYS_UNISTD_H_
 #define        _SYS_UNISTD_H_
 
-/* compile-time symbolic constants */
-#define        _POSIX_JOB_CONTROL      /* implementation supports job control */
-
 /*
  * Although we have saved user/group IDs, we do not use them in setuid
  * as described in POSIX 1003.1, because the feature does not work for
 #define        _POSIX_SAVED_IDS        /* saved set-user-ID and set-group-ID */
 #endif
 
-#define        _POSIX_VERSION          198808L
-#define        _POSIX2_VERSION         199212L
+#define        _POSIX_VERSION          200112L
+#define        _POSIX2_VERSION         200112L
 
 /* execution-time symbolic constants */
-                               /* chown requires appropriate privileges */
-#define        _POSIX_CHOWN_RESTRICTED 1
-                               /* too-long path components generate errors */
-#define        _POSIX_NO_TRUNC         1
                                /* may disable terminal special characters */
 #ifndef _POSIX_VDISABLE
 #define        _POSIX_VDISABLE         ((unsigned char)'\377')
 #endif
 
-#define _POSIX_THREADS
-#define _POSIX_THREAD_ATTR_STACKADDR
-#define _POSIX_THREAD_ATTR_STACKSIZE
-#define _POSIX_THREAD_PRIORITY_SCHEDULING
-#define _POSIX_THREAD_PRIO_INHERIT
-#define _POSIX_THREAD_PRIO_PROTECT
-
 #define _POSIX_THREAD_KEYS_MAX 128
 
 /* access function */
 #define        F_OK            0       /* test for existence of file */
-#define        X_OK            0x01    /* test for execute or search permission */
-#define        W_OK            0x02    /* test for write permission */
-#define        R_OK            0x04    /* test for read permission */
+#define        X_OK            (1<<0)  /* test for execute or search permission */
+#define        W_OK            (1<<1)  /* test for write permission */
+#define        R_OK            (1<<2)  /* test for read permission */
+
+#ifndef _POSIX_C_SOURCE
+/*
+ * Extended access functions.
+ * Note that we depend on these matching the definitions in sys/kauth.h,
+ * but with the bits shifted left by 8.
+ */
+#define _READ_OK       (1<<9)  /* read file data / read directory */
+#define _WRITE_OK      (1<<10) /* write file data / add file to directory */
+#define _EXECUTE_OK    (1<<11) /* execute file / search in directory*/
+#define _DELETE_OK     (1<<12) /* delete file / delete directory */
+#define _APPEND_OK     (1<<13) /* append to file / add subdirectory to directory */
+#define _RMFILE_OK     (1<<14) /* - / remove file from directory */
+#define _RATTR_OK      (1<<15) /* read basic attributes */
+#define _WATTR_OK      (1<<16) /* write basic attributes */
+#define _REXT_OK       (1<<17) /* read extended attributes */
+#define _WEXT_OK       (1<<18) /* write extended attributes */
+#define _RPERM_OK      (1<<19) /* read permissions */
+#define _WPERM_OK      (1<<20) /* write permissions */
+#define _CHOWN_OK      (1<<21) /* change ownership */
+
+#define _ACCESS_EXTENDED_MASK (_READ_OK | _WRITE_OK | _EXECUTE_OK | \
+                               _DELETE_OK | _APPEND_OK | \
+                               _RMFILE_OK | _REXT_OK | \
+                               _WEXT_OK | _RATTR_OK | _WATTR_OK | _RPERM_OK | \
+                               _WPERM_OK | _CHOWN_OK)
+#endif
 
 /* whence values for lseek(2) */
+#ifndef SEEK_SET
 #define        SEEK_SET        0       /* set file offset to offset */
 #define        SEEK_CUR        1       /* set file offset to current plus offset */
 #define        SEEK_END        2       /* set file offset to EOF plus offset */
+#endif /* !SEEK_SET */
 
-#ifndef _POSIX_SOURCE
+#ifndef _POSIX_C_SOURCE
 /* whence values for lseek(2); renamed by POSIX 1003.1 */
 #define        L_SET           SEEK_SET
 #define        L_INCR          SEEK_CUR
 #define        L_XTND          SEEK_END
 #endif
 
+#ifndef _POSIX_C_SOURCE
+struct accessx_descriptor {
+       unsigned ad_name_offset;
+       int ad_flags;
+       int ad_pad[2];
+};
+#define ACCESSX_MAX_DESCRIPTORS        100
+#define ACCESSX_MAX_TABLESIZE  (16 * 1024)
+#endif
+
 /* configurable pathname variables */
 #define        _PC_LINK_MAX             1
 #define        _PC_MAX_CANON            2
 #define        _PC_NO_TRUNC             8
 #define        _PC_VDISABLE             9
 
-#ifndef _POSIX_SOURCE
+#ifndef _POSIX_C_SOURCE
 #define        _PC_NAME_CHARS_MAX       10
 #define        _PC_CASE_SENSITIVE               11
 #define        _PC_CASE_PRESERVING              12
+#define _PC_EXTENDED_SECURITY_NP        13
+#define _PC_AUTH_OPAQUE_NP      14
 #endif
 
-/* configurable system variables */
-#define        _SC_ARG_MAX              1
-#define        _SC_CHILD_MAX            2
-#define        _SC_CLK_TCK              3
-#define        _SC_NGROUPS_MAX          4
-#define        _SC_OPEN_MAX             5
-#define        _SC_JOB_CONTROL          6
-#define        _SC_SAVED_IDS            7
-#define        _SC_VERSION              8
-#define        _SC_BC_BASE_MAX          9
-#define        _SC_BC_DIM_MAX          10
-#define        _SC_BC_SCALE_MAX        11
-#define        _SC_BC_STRING_MAX       12
-#define        _SC_COLL_WEIGHTS_MAX    13
-#define        _SC_EXPR_NEST_MAX       14
-#define        _SC_LINE_MAX            15
-#define        _SC_RE_DUP_MAX          16
-#define        _SC_2_VERSION           17
-#define        _SC_2_C_BIND            18
-#define        _SC_2_C_DEV             19
-#define        _SC_2_CHAR_TERM         20
-#define        _SC_2_FORT_DEV          21
-#define        _SC_2_FORT_RUN          22
-#define        _SC_2_LOCALEDEF         23
-#define        _SC_2_SW_DEV            24
-#define        _SC_2_UPE               25
-#define        _SC_STREAM_MAX          26
-#define        _SC_TZNAME_MAX          27
-
 /* configurable system strings */
 #define        _CS_PATH                 1