Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/fcntl.h
Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | |||||
/* Defined by POSIX 1003.1-2008; BSD default, but reserve for future use. */ | /* Defined by POSIX 1003.1-2008; BSD default, but reserve for future use. */ | ||||
#define O_TTY_INIT 0x00080000 /* Restore default termios attributes */ | #define O_TTY_INIT 0x00080000 /* Restore default termios attributes */ | ||||
#define O_CLOEXEC 0x00100000 | #define O_CLOEXEC 0x00100000 | ||||
#endif | #endif | ||||
#if __BSD_VISIBLE | #if __BSD_VISIBLE | ||||
#define O_VERIFY 0x00200000 /* open only after verification */ | #define O_VERIFY 0x00200000 /* open only after verification */ | ||||
/* #define O_UNUSED1 0x00400000 */ /* Was O_BENEATH */ | #define O_PATH 0x00400000 /* fd is only a path */ | ||||
#define O_RESOLVE_BENEATH 0x00800000 /* Do not allow name resolution to walk | #define O_RESOLVE_BENEATH 0x00800000 /* Do not allow name resolution to walk | ||||
out of cwd */ | out of cwd */ | ||||
#endif | #endif | ||||
#define O_DSYNC 0x01000000 /* POSIX data sync */ | #define O_DSYNC 0x01000000 /* POSIX data sync */ | ||||
/* | /* | ||||
* XXX missing O_RSYNC. | * XXX missing O_RSYNC. | ||||
*/ | */ | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
/* Only for devfs d_close() flags. */ | /* Only for devfs d_close() flags. */ | ||||
#define FLASTCLOSE O_DIRECTORY | #define FLASTCLOSE O_DIRECTORY | ||||
#define FREVOKE O_VERIFY | #define FREVOKE O_VERIFY | ||||
/* Only for fo_close() from half-succeeded open */ | /* Only for fo_close() from half-succeeded open */ | ||||
#define FOPENFAILED O_TTY_INIT | #define FOPENFAILED O_TTY_INIT | ||||
/* convert from open() flags to/from fflags; convert O_RD/WR to FREAD/FWRITE */ | /* convert from open() flags to/from fflags; convert O_RD/WR to FREAD/FWRITE */ | ||||
#define FFLAGS(oflags) ((oflags) & O_EXEC ? (oflags) : (oflags) + 1) | #define FFLAGS(oflags) ((oflags) & O_EXEC ? (oflags) : (oflags) + 1) | ||||
#define OFLAGS(fflags) ((fflags) & O_EXEC ? (fflags) : (fflags) - 1) | #define OFLAGS(fflags) ((fflags) & O_EXEC ? (fflags) : (fflags) - 1) | ||||
markj: Should it be `(fflags & (O_EXEC | O_PATH))`? | |||||
/* bits to save after open */ | /* bits to save after open */ | ||||
#define FMASK (FREAD|FWRITE|FAPPEND|FASYNC|FFSYNC|FDSYNC|FNONBLOCK|O_DIRECT|FEXEC) | #define FMASK (FREAD|FWRITE|FAPPEND|FASYNC|FFSYNC|FDSYNC|FNONBLOCK|O_DIRECT|FEXEC) | ||||
Done Inline ActionsI think O_PATH should be included here, else it is not returned by fcntl(F_GETFL), contrary to Linux. markj: I think O_PATH should be included here, else it is not returned by fcntl(F_GETFL), contrary to… | |||||
/* bits settable by fcntl(F_SETFL, ...) */ | /* bits settable by fcntl(F_SETFL, ...) */ | ||||
#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FDSYNC|FNONBLOCK|FRDAHEAD|O_DIRECT) | #define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FDSYNC|FNONBLOCK|FRDAHEAD|O_DIRECT) | ||||
#if defined(COMPAT_FREEBSD7) || defined(COMPAT_FREEBSD6) || \ | #if defined(COMPAT_FREEBSD7) || defined(COMPAT_FREEBSD6) || \ | ||||
defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) | defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) | ||||
/* | /* | ||||
* Set by shm_open(3) in older libc's to get automatic MAP_ASYNC | * Set by shm_open(3) in older libc's to get automatic MAP_ASYNC | ||||
* behavior for POSIX shared memory objects (which are otherwise | * behavior for POSIX shared memory objects (which are otherwise | ||||
▲ Show 20 Lines • Show All 195 Lines • Show Last 20 Lines |
Should it be (fflags & (O_EXEC | O_PATH))?