Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Jun 2007 09:06:44 GMT
From:      Roman Divacky <rdivacky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 122068 for review
Message-ID:  <200706210906.l5L96iAN011198@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=122068

Change 122068 by rdivacky@rdivacky_witten on 2007/06/21 09:06:06

	Introduce fcntl.h part of POSIX Extended API:
	
	o	remove __BSD_VISIBLE around O_NOFOLLOW, its POSIX now
	o	add AT_FDCWD, AT_SYMLINK_NOFOLLOW, AT_SYMLINK_FOLLOW, AT_REMOVEDIR
	o	add AT_EACCESS but ifdefed out for the moment
	o	add O_DIRECTORY
	o	add openat() prototype
	
	this is a WIP and commits to other files will follow

Affected files ...

.. //depot/projects/soc2007/rdivacky/linux_at/sys/sys/fcntl.h#4 edit

Differences ...

==== //depot/projects/soc2007/rdivacky/linux_at/sys/sys/fcntl.h#4 (text+ko) ====

@@ -96,16 +96,24 @@
 #define	O_FSYNC		0x0080		/* synchronous writes */
 #endif
 #define	O_SYNC		0x0080		/* POSIX synonym for O_FSYNC */
-#if __BSD_VISIBLE
 #define	O_NOFOLLOW	0x0100		/* don't follow symlinks */
-#endif
 #define	O_CREAT		0x0200		/* create if nonexistent */
 #define	O_TRUNC		0x0400		/* truncate to zero length */
 #define	O_EXCL		0x0800		/* error if already exists */
 #ifdef _KERNEL
 #define	FHASLOCK	0x4000		/* descriptor holds advisory lock */
 #endif
-#define	AT_FDCWD	-100		/* CWD for *at syscals */
+/* Defined by POSIX Extended API ... TODO: number of the spec */
+#define	AT_FDCWD		-100	/* Use the current working directory
+					   to determine the target of relative
+					   file paths.
+					 */
+#ifdef notyet
+#define	AT_EACCESS		0x100	/* Check access using effective user and group ID */
+#endif
+#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 */
 
 /* Defined by POSIX 1003.1; BSD default, but must be distinct from O_RDONLY. */
 #define	O_NOCTTY	0x8000		/* don't assign controlling terminal */
@@ -115,6 +123,9 @@
 #define O_DIRECT	0x00010000
 #endif
 
+/* Defined by POSIX Extended API ... TODO: number of the spec */
+#define	O_DIRECTORY	0x00020000	/* Fail if not directory */
+
 /*
  * XXX missing O_DSYNC, O_RSYNC.
  */
@@ -221,6 +232,7 @@
 int	open(const char *, int, ...);
 int	creat(const char *, mode_t);
 int	fcntl(int, int, ...);
+int	openat(int, const char *, int, ...);
 #if __BSD_VISIBLE
 int	flock(int, int);
 #endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706210906.l5L96iAN011198>