#include <sys/fcntl.h>

sys/fcntl.h Kernel.framework

includes: sys/_types.h, sys/cdefs.h, sys/_types/_size_t.h, Kernel/sys/_types/_mode_t.h, Kernel/sys/_types/_off_t.h, Kernel/sys/_types/_pid_t.h, Kernel/sys/_types/_o_sync.h, Kernel/sys/_types/_o_dsync.h, Kernel/sys/_types/_seek_set.h, Kernel/sys/_types/_s_ifmt.h, Kernel/sys/_types/_timespec.h, sys/_types/_user32_timespec.h
27 macros · 6 structs · 5 typedefs

macroFMARK

#define FMARK 0x00001000
mark during gc(), same value as O_RESOLVE_BENEATH

macroFDEFER

#define FDEFER 0x00002000
defer for next gc pass, same value as O_UNIQUE

macroFWASLOCKED

#define FWASLOCKED 0x00004000
has or has had an advisory fcntl lock

macroFHASLOCK

#define FHASLOCK FWASLOCKED
obsolete compatibility name

macroFWASWRITTEN

#define FWASWRITTEN 0x00010000
descriptor was written

macroFNOCACHE

#define FNOCACHE 0x00040000
fcntl(F_NOCACHE, 1)

macroFNORDAHEAD

#define FNORDAHEAD 0x00080000
fcntl(F_RDAHEAD, 0)

macroFNODIRECT

#define FNODIRECT 0x00800000
fcntl(F_NODIRECT, 1)

macroFENCRYPTED

#define FENCRYPTED 0x02000000

macroFSINGLE_WRITER

#define FSINGLE_WRITER 0x04000000
fcntl(F_SINGLE_WRITER, 1)

macroO_CLOFORK

#define O_CLOFORK 0x08000000
implicitly set FD_CLOFORK

macroFUNENCRYPTED

#define FUNENCRYPTED 0x10000000

macroFEXEC

#define FEXEC O_EXEC

macroFSEARCH

#define FSEARCH FEXEC

macroFFLAGS

convert from open() flags to/from fflags; convert O_RD/WR to FREAD/FWRITE O_EXEC turns off FREAD/FWRITE
#define FFLAGS(oflags) (((oflags) & O_EXEC) ? ((oflags) & ~(O_ACCMODE)) : ((oflags) + 1))

macroOFLAGS

There is no way to convey a lack of O_RDONLY but the presence of O_EXEC means that
#define OFLAGS(fflags) (((fflags) & FEXEC) ? ((fflags) & ~(O_ACCMODE)) : ((fflags) - 1))

macroFMASK

bits to save after open
#define FMASK (FREAD|FWRITE|FAPPEND|FASYNC|FFSYNC|FFDSYNC|FNONBLOCK|FEXEC)

macroFCNTLFLAGS

bits settable by fcntl(F_SETFL, ...)
#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FFDSYNC|FNONBLOCK)

macroF_WAIT

#define F_WAIT 0x010
Wait until lock is granted

macroF_FLOCK

#define F_FLOCK 0x020
Use flock(2) semantics for lock

macroF_POSIX

#define F_POSIX 0x040
Use POSIX semantics for lock

macroF_PROV

#define F_PROV 0x080
Non-coalesced provisional lock

macroF_WAKE1_SAFE

#define F_WAKE1_SAFE 0x100
its safe to only wake one waiter

macroF_ABORT

#define F_ABORT 0x200
lock attempt aborted (force umount)

macroF_OFD_LOCK

#define F_OFD_LOCK 0x400
Use "OFD" semantics for lock

macroF_TRANSFER

#define F_TRANSFER 0x800
Transfer the lock to new proc

macroF_CONFINED

#define F_CONFINED 0x1000
fileglob cannot leave curproc

structuser32_flocktimeout

size 32, align 8
struct flockflflock passed for file locking
struct user32_timespectimeouttimespec struct for timeout

structuser32_fsignatures

size 16, align 8
off_tfs_file_start
user32_addr_tfs_blob_start
user32_size_tfs_blob_size

typedefuser32_fsignatures_t

typedef struct user32_fsignatures user32_fsignatures_t;

structuser_fsignatures

size 56, align 8
off_tfs_file_startoffset of Mach-O image in FAT file
user_addr_tfs_blob_startF_ADDSIGS: mem address of signature
user_size_tfs_blob_sizeF_ADDFILESIGS: offset of signature in Mach-O image size of signature blob
user_size_tfs_fsignatures_sizeThe following fields are only applicable to F_ADDFILESIGS_INFO. Prior to F_ADDFILESIGS_INFO, this struct ended after fs_blob_size. input: size of this struct (for compatibility)
char[20]fs_cdhashoutput: cdhash
intfs_hash_typeoutput: hash algorithm type for cdhash

typedefuser_fsignatures_t

typedef struct user_fsignatures user_fsignatures_t;

structuser_fsupplement

size 32, align 8
off_tfs_file_startoffset of Mach-O image in FAT file
off_tfs_blob_startoffset of signature in Mach-O image
size_tfs_blob_sizesignature blob size
intfs_orig_fdfile descriptor to original image

typedefuser_fsupplement_t

typedef struct user_fsupplement user_fsupplement_t;

structuser32_fchecklv

size 16, align 8
user32_off_tlv_file_start
user32_size_tlv_error_message_size
user32_addr_tlv_error_message

typedefuser32_fchecklv_t

typedef struct user32_fchecklv user32_fchecklv_t;

structuser_fchecklv

size 24, align 8
off_tlv_file_start
user_size_tlv_error_message_size
user_addr_tlv_error_message

typedefuser_fchecklv_t

typedef struct user_fchecklv user_fchecklv_t;