Now that all of the new AT_* flags are supported, it's okay to expose openat(2), etc. in libc.
This will need at least a minor libc bump (not included below). I know martynas@ has a major bump planned for libc, so I figure it makes sense to either go before that or ride the same bump. Opinions welcome. ok? Index: sys/sys/fcntl.h =================================================================== RCS file: /home/mdempsky/anoncvs/cvs/src/sys/sys/fcntl.h,v retrieving revision 1.13 diff -u -p -r1.13 fcntl.h --- sys/sys/fcntl.h 7 Jul 2011 23:45:00 -0000 1.13 +++ sys/sys/fcntl.h 8 Jul 2011 04:44:41 -0000 @@ -200,6 +200,9 @@ int fcntl(int, int, ...); #if __BSD_VISIBLE int flock(int, int); #endif +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 +int openat(int, const char *, int, ...); +#endif __END_DECLS #endif Index: sys/sys/stat.h =================================================================== RCS file: /home/mdempsky/anoncvs/cvs/src/sys/sys/stat.h,v retrieving revision 1.17 diff -u -p -r1.17 stat.h --- sys/sys/stat.h 29 Jan 2009 22:08:45 -0000 1.17 +++ sys/sys/stat.h 8 Jul 2011 04:44:41 -0000 @@ -237,6 +237,13 @@ int fchmod(int, mode_t); int lstat(const char *, struct stat *); int isfdtype(int, int); #endif +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 +int fchmodat(int, const char *, mode_t, int); +int fstatat(int, const char *, struct stat *, int); +int mkdirat(int, const char *, mode_t); +int mkfifoat(int, const char *, mode_t); +int mknodat(int, const char *, mode_t, dev_t); +#endif __END_DECLS #endif #endif /* !_SYS_STAT_H_ */ Index: include/unistd.h =================================================================== RCS file: /home/mdempsky/anoncvs/cvs/src/include/unistd.h,v retrieving revision 1.64 diff -u -p -r1.64 unistd.h --- include/unistd.h 3 Jul 2011 18:51:01 -0000 1.64 +++ include/unistd.h 8 Jul 2011 04:44:41 -0000 @@ -203,6 +203,17 @@ int setegid(gid_t); int seteuid(uid_t); #endif +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 +int faccessat(int, const char *, int, int); +int fchownat(int, const char *, uid_t, gid_t, int); +int linkat(int, const char *, int, const char *, int); +int readlinkat(int, const char *, char *, size_t); +int renameat(int, const char *, int, const char *); +int symlinkat(const char *, int, const char *); +int unlinkat(int, const char *, int); +int utimensat(int, const char *, const struct timespec *, int); +#endif + #if __BSD_VISIBLE int acct(const char *); int closefrom(int); Index: lib/libc/sys/Makefile.inc =================================================================== RCS file: /home/mdempsky/anoncvs/cvs/src/lib/libc/sys/Makefile.inc,v retrieving revision 1.92 diff -u -p -r1.92 Makefile.inc --- lib/libc/sys/Makefile.inc 3 Jul 2010 04:44:51 -0000 1.92 +++ lib/libc/sys/Makefile.inc 8 Jul 2011 04:44:41 -0000 @@ -67,7 +67,10 @@ ASM= accept.o access.o acct.o adjfreq.o utimes.o wait4.o write.o writev.o nnpfspioctl.o __semctl.o \ __syscall.o __sysctl.o __getcwd.o sched_yield.o getthrid.o \ thrsleep.o thrwakeup.o threxit.o thrsigdivert.o \ - setrtable.o getrtable.o + setrtable.o getrtable.o \ + openat.o fchmodat.o fstatat.o mkdirat.o mkfifoat.o mknodat.o \ + faccessat.o fchownat.o linkat.o readlinkat.o renameat.o symlinkat.o \ + unlinkat.o utimensat.o GASM= ${ASM:.o=.go} PASM= ${ASM:.o=.po}