From 509a01fadd1261181b7a24120d78706415c412c0 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sun, 1 Aug 2010 11:02:12 +0200 Subject: [PATCH] Mark the *at(2) system calls' prototypes as being new in IEEE 1003.1-2008. This is to prevent them from being exposed if an earlier version is explicitly requested. Mark them with __BSD_VISIBLE too so they are still exposed in our default programming environment. --- include/unistd.h | 8 +++++++- sys/sys/fcntl.h | 2 ++ sys/sys/stat.h | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/unistd.h b/include/unistd.h index d864fb7497..8ad0c0f588 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -315,11 +315,15 @@ __BEGIN_DECLS /* 1003.1-1990 */ void _exit(int) __dead2; int access(const char *, int); +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 int faccessat(int, const char *, int, int); +#endif unsigned int alarm(unsigned int); int chdir(const char *); int chown(const char *, uid_t, gid_t); +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 int fchownat(int, const char *, uid_t, gid_t, int); +#endif int close(int); int dup(int); int dup2(int, int); @@ -361,9 +365,11 @@ long sysconf(int); pid_t tcgetpgrp(int); int tcsetpgrp(int, pid_t); char *ttyname(int); -int ttyname_r(int, char *, size_t); +int ttyname_r(int, char *, size_t); int unlink(const char *); +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 int unlinkat(int, const char *, int); +#endif ssize_t write(int, const void *, size_t); /* 1003.2-1992 */ diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h index bd49cf42c3..8faca3e0f8 100644 --- a/sys/sys/fcntl.h +++ b/sys/sys/fcntl.h @@ -242,7 +242,9 @@ union fcntl_dat { __BEGIN_DECLS int open (const char *, int, ...); +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 int openat (int, const char *, int, ...); +#endif int creat (const char *, mode_t); int fcntl (int, int, ...); #ifndef _POSIX_SOURCE diff --git a/sys/sys/stat.h b/sys/sys/stat.h index 693080e874..6c07fc8e60 100644 --- a/sys/sys/stat.h +++ b/sys/sys/stat.h @@ -213,9 +213,13 @@ struct stat { __BEGIN_DECLS int chmod (const char *, mode_t); +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 int fchmodat (int, const char *, mode_t, int); +#endif int fstat (int, struct stat *); +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 int fstatat (int, const char *, struct stat *, int); +#endif int mkdir (const char *, mode_t); int mkfifo (const char *, mode_t); #if !defined(_MKNOD_DECLARED) && __XSI_VISIBLE -- 2.41.0