From 8c7f0a896773b325db79e4a03d07b0193888c058 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Mon, 5 Mar 2012 20:17:26 -0500 Subject: [PATCH] Cleanup the flags and make them the same as FreeBSD --- src/build/libroot/fs_darwin.cpp | 8 -------- src/build/libroot/fs_darwin.h | 20 +++++++++++++------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/build/libroot/fs_darwin.cpp b/src/build/libroot/fs_darwin.cpp index 61311dc362..86206df0f7 100644 --- a/src/build/libroot/fs_darwin.cpp +++ b/src/build/libroot/fs_darwin.cpp @@ -279,14 +279,6 @@ fchownat(int fd, const char* path, uid_t owner, gid_t group, int flag) int fstatat(int fd, const char *path, struct stat *st, int flag) { - if ((flag & AT_NO_AUTOMOUNT) == 0) { - // Don't automount the terminal ("basename") component of pathname if - // it is a directory that is an automount point. - // CURRENTLY UNSUPPORTED - errno = ENOTSUP; - return -1; - } - if ((flag & AT_SYMLINK_NOFOLLOW) == 0) { // do not dereference, instead return information about the link // itself diff --git a/src/build/libroot/fs_darwin.h b/src/build/libroot/fs_darwin.h index 8592b04a13..1ac2e86620 100644 --- a/src/build/libroot/fs_darwin.h +++ b/src/build/libroot/fs_darwin.h @@ -5,15 +5,21 @@ #ifndef FS_DARWIN_H #define FS_DARWIN_H -/* flags for the *at() functions */ -#define AT_FDCWD (-1) /* CWD FD for the *at() functions */ +/* + * 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 /* CWD FD for the *at() functions */ -#define AT_SYMLINK_NOFOLLOW 0x01 /* fstatat(), fchmodat(), fchownat(), +/* + * Miscellaneous flags for the *at() syscalls. + */ +#define AT_EACCESS 0x100 /* faccessat() */ +#define AT_SYMLINK_NOFOLLOW 0x200 /* fstatat(), fchmodat(), fchownat(), utimensat() */ -#define AT_SYMLINK_FOLLOW 0x02 /* linkat() */ -#define AT_REMOVEDIR 0x04 /* unlinkat() */ -#define AT_EACCESS 0x08 /* faccessat() */ -#define AT_NO_AUTOMOUNT 0x10 /* fstatat */ +#define AT_SYMLINK_FOLLOW 0x400 /* linkat() */ +#define AT_REMOVEDIR 0x800 /* unlinkat() */ int eaccess(const char* path, int accessMode); int faccessat(int fd, const char* path, int accessMode, int flag);