summaryrefslogtreecommitdiffstats
path: root/sys/sys/fcntl.h
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2008-03-31 11:55:10 +0000
committerkib <kib@FreeBSD.org>2008-03-31 11:55:10 +0000
commit9ab7de877c11a4496f6475423a81212c2a412aba (patch)
treea75dcdeeeda542a00abae74d831da96b4faade71 /sys/sys/fcntl.h
parentfe816f911f1158c855969c8149c56dc1e43e8007 (diff)
downloadFreeBSD-src-9ab7de877c11a4496f6475423a81212c2a412aba.zip
FreeBSD-src-9ab7de877c11a4496f6475423a81212c2a412aba.tar.gz
Add the constant definition needed by the implementation of the
openat() and the related syscalls. Based on the submission by rdivacky, sponsored by Google Summer of Code 2007 Reviewed by: rwatson, rdivacky Tested by: pho
Diffstat (limited to 'sys/sys/fcntl.h')
-rw-r--r--sys/sys/fcntl.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h
index 29c7796..c455436 100644
--- a/sys/sys/fcntl.h
+++ b/sys/sys/fcntl.h
@@ -105,6 +105,23 @@ typedef __pid_t pid_t;
#ifdef _KERNEL
#define FHASLOCK 0x4000 /* descriptor holds advisory lock */
#endif
+/* Defined by POSIX Extended API Set Part 2 */
+#if __BSD_VISIBLE
+/*
+ * Magic value that specify the use of the current working directory
+ * to determine the target of relative file paths in the openat() and
+ * similar syscalls.
+ */
+#define AT_FDCWD -100
+
+/*
+ * Miscellaneous flags for the *at() syscalls.
+ */
+#define AT_EACCESS 0x100 /* Check access using effective user and group ID */
+#define AT_SYMLINK_NOFOLLOW 0x200 /* Do not follow symbolic links */
+#define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic link */
+#define AT_REMOVEDIR 0x800 /* Remove directory instead of file */
+#endif
/* Defined by POSIX 1003.1; BSD default, but must be distinct from O_RDONLY. */
#define O_NOCTTY 0x8000 /* don't assign controlling terminal */
@@ -114,6 +131,15 @@ typedef __pid_t pid_t;
#define O_DIRECT 0x00010000
#endif
+/* Defined by POSIX Extended API Set Part 2 */
+#if __BSD_VISIBLE
+#define O_DIRECTORY 0x00020000 /* Fail if not directory */
+#define O_EXEC 0x00040000 /* Open for execute only */
+#endif
+#ifdef _KERNEL
+#define FEXEC O_EXEC
+#endif
+
/*
* XXX missing O_DSYNC, O_RSYNC.
*/
@@ -124,7 +150,7 @@ typedef __pid_t pid_t;
#define OFLAGS(fflags) ((fflags) - 1)
/* bits to save after open */
-#define FMASK (FREAD|FWRITE|FAPPEND|FASYNC|FFSYNC|FNONBLOCK|O_DIRECT)
+#define FMASK (FREAD|FWRITE|FAPPEND|FASYNC|FFSYNC|FNONBLOCK|O_DIRECT|FEXEC)
/* bits settable by fcntl(F_SETFL, ...) */
#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|O_DIRECT)
OpenPOWER on IntegriCloud