diff --git a/headers/posix/fcntl.h b/headers/posix/fcntl.h index fa6f0a307d..591565b80b 100644 --- a/headers/posix/fcntl.h +++ b/headers/posix/fcntl.h @@ -64,11 +64,13 @@ #define O_SHLOCK 0x01000000 /* obtain shared lock */ #define O_EXLOCK 0x02000000 /* obtain exclusive lock */ +#ifdef B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT #define AT_FDCWD (-1) /* CWD FD for the *at() functions */ #define AT_SYMLINK_NOFOLLOW 0x1 /* fstatat(), fchmodat(), fchownat(), utimensat() */ #define AT_SYMLINK_FOLLOW 0x2 /* linkat() */ +#endif /* advisory file locking */ @@ -89,7 +91,9 @@ extern int creat(const char *path, mode_t mode); extern int open(const char *path, int openMode, ...); /* the third argument is the permissions of the created file when O_CREAT is passed in oflags */ +#ifdef B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT extern int openat(int fd, const char *path, int openMode, ...); +#endif extern int fcntl(int fd, int op, ...); diff --git a/headers/posix/sys/stat.h b/headers/posix/sys/stat.h index 530f53e64d..6f7ee499a5 100644 --- a/headers/posix/sys/stat.h +++ b/headers/posix/sys/stat.h @@ -110,7 +110,9 @@ extern int fchmod(int fd, mode_t mode); extern int stat(const char *path, struct stat *st); extern int fstat(int fd, struct stat *st); extern int lstat(const char *path, struct stat *st); +#ifdef B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT extern int fstatat(int fd, const char *path, struct stat *st, int flag); +#endif extern int mkdir(const char *path, mode_t mode); extern int mkfifo(const char *path, mode_t mode); extern mode_t umask(mode_t cmask); diff --git a/headers/posix/unistd.h b/headers/posix/unistd.h index 3b9c55c4e7..e5107b0e5a 100644 --- a/headers/posix/unistd.h +++ b/headers/posix/unistd.h @@ -138,8 +138,10 @@ extern int unlink(const char *name); extern int rmdir(const char *path); extern ssize_t readlink(const char *path, char *buffer, size_t bufferSize); +#ifdef B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT extern ssize_t readlinkat(int fd, const char *path, char *buffer, size_t bufferSize); +#endif extern int symlink(const char *from, const char *to); extern int ftruncate(int fd, off_t newSize); diff --git a/src/system/libroot/posix/fcntl.cpp b/src/system/libroot/posix/fcntl.cpp index 886025b32d..23aeebccf3 100644 --- a/src/system/libroot/posix/fcntl.cpp +++ b/src/system/libroot/posix/fcntl.cpp @@ -7,6 +7,9 @@ */ +#define B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT 1 + // make the *at() functions and AT_* macros visible + #include #include #include diff --git a/src/system/libroot/posix/sys/stat.c b/src/system/libroot/posix/sys/stat.c index 15cf9e8e99..de266a1727 100644 --- a/src/system/libroot/posix/sys/stat.c +++ b/src/system/libroot/posix/sys/stat.c @@ -4,6 +4,9 @@ * Distributed under the terms of the MIT License. */ +#define B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT 1 + // make the *at() functions and AT_* macros visible + #include #include diff --git a/src/system/libroot/posix/unistd/link.c b/src/system/libroot/posix/unistd/link.c index 9925154aa1..a2126cdb08 100644 --- a/src/system/libroot/posix/unistd/link.c +++ b/src/system/libroot/posix/unistd/link.c @@ -4,6 +4,9 @@ */ +#define B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT 1 + // make the *at() functions and AT_* macros visible + #include #include #include