#include <sys/unistd.h>
sys/unistd.h
macro_POSIX_VERSION
#define _POSIX_VERSION 200112L
macro_POSIX2_VERSION
#define _POSIX2_VERSION 200112L
macro_POSIX_THREAD_KEYS_MAX
#define _POSIX_THREAD_KEYS_MAX 128
macro_READ_OK
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
macro_ACCESS_EXTENDED_MASK
#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)
structaccessx_descriptor
| unsigned int | ad_name_offset | |
| int | ad_flags | |
| int[2] | ad_pad |
macroACCESSX_MAX_DESCRIPTORS
#define ACCESSX_MAX_DESCRIPTORS 100
macroACCESSX_MAX_TABLESIZE
#define ACCESSX_MAX_TABLESIZE (16 * 1024)
macro_PC_MAX_CANON
#define _PC_MAX_CANON 2
macro_PC_MAX_INPUT
#define _PC_MAX_INPUT 3
macro_PC_NAME_MAX
#define _PC_NAME_MAX 4
macro_PC_PATH_MAX
#define _PC_PATH_MAX 5
macro_PC_PIPE_BUF
#define _PC_PIPE_BUF 6
macro_PC_CHOWN_RESTRICTED
#define _PC_CHOWN_RESTRICTED 7
macro_PC_NO_TRUNC
#define _PC_NO_TRUNC 8
macro_PC_VDISABLE
#define _PC_VDISABLE 9
macro_PC_NAME_CHARS_MAX
#define _PC_NAME_CHARS_MAX 10
macro_PC_CASE_SENSITIVE
#define _PC_CASE_SENSITIVE 11
macro_PC_CASE_PRESERVING
#define _PC_CASE_PRESERVING 12
macro_PC_EXTENDED_SECURITY_NP
#define _PC_EXTENDED_SECURITY_NP 13
macro_PC_AUTH_OPAQUE_NP
#define _PC_AUTH_OPAQUE_NP 14
functiongetattrlistbulk
__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0) int getattrlistbulk(int, void *, void *, size_t, uint64_t)
man page · November 15, 2013
getattrlistbulk(2) — get file system attributes for multiple directory entries⚠ the man page prototype differs from the current header — man:
int getattrlistbulk(int, struct attrlist*, void*, size_t, u64) · header: int getattrlistbulk(int, void*, void*, size_t, u64)functiongetattrlistat
__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0) int getattrlistat(int, const char *, void *, void *, size_t, unsigned long)
man page · March 7, 2025
getattrlistat(2) — get file system attributes⚠ the man page prototype differs from the current header — man:
int getattrlistat(int, char*, struct attrlist*, void*, size_t, unsigned long) · header: int getattrlistat(int, char*, void*, void*, size_t, unsigned long)functionsetattrlistat
__OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) __TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0) int setattrlistat(int, const char *, void *, void *, size_t, uint32_t)
man page · December 15, 2003
setattrlistat(2) — set file system attributes⚠ the man page prototype differs from the current header — man:
int setattrlistat(int, char*, struct attrlist*, void*, size_t, unsigned) · header: int setattrlistat(int, char*, void*, void*, size_t, unsigned)functionfreadlink
__API_AVAILABLE(macos(13.0), ios(16.0), tvos(16.0), watchos(9.0)) ssize_t freadlink(int, char * __restrict, size_t)
man page · June 4, 1993
freadlink(2) — read value of a symbolic linkfunctionfaccessat
__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0)
int faccessat(int, const char *, int, int)man page · September 15, 2014
faccessat(2) — check accessibility of a filefunctionfchownat
__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0) int fchownat(int, const char *, uid_t, gid_t, int)
man page · April 19, 1994
fchownat(2) — change owner and group of a filefunctionlinkat
__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0)
int linkat(int, const char *, int, const char *, int)man page · June 3, 2021
linkat(2) — make a hard file linkfunctionreadlinkat
__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0) ssize_t readlinkat(int, const char *, char *, size_t)
man page · June 4, 1993
readlinkat(2) — read value of a symbolic linkfunctionsymlinkat
__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0)
int symlinkat(const char *, int, const char *)man page · June 4, 1993
symlinkat(2) — make symbolic link to a filefunctionunlinkat
__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0)
int unlinkat(int, const char *, int)man page · June 4, 1993
unlinkat(2) — remove directory entry