From b8d3e9f6317fcdffbc920ecb8c4fec1ef97c2d09 Mon Sep 17 00:00:00 2001 From: matthew <> Date: Mon, 18 Jul 2011 17:29:49 +0000 Subject: [PATCH] Expose a bunch of new functionality from POSIX 2008: openat(2), fchmodat(2), fstatat(2), mkdirat(2), mkfifoat(2), mknodat(2), faccessat(2), fchownat(2), linkat(2), readlinkat(2), renameat(2), symlinkat(2), unlinkat(2), utimensat(2), futimens(2), and fdopendir(3). "Minor" libc bump. Tested in a bulk build by naddy@ Much help from guenther@, thib@, tedu@, oga@, and others. ok deraadt@, naddy@ --- src/include/dirent.h | 5 ++++- src/include/stdio.h | 5 ++++- src/include/unistd.h | 11 ++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/include/dirent.h b/src/include/dirent.h index eeb5d1ba..6e6cf55f 100644 --- a/src/include/dirent.h +++ b/src/include/dirent.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dirent.h,v 1.23 2011/07/14 02:16:00 deraadt Exp $ */ +/* $OpenBSD: dirent.h,v 1.24 2011/07/18 17:29:49 matthew Exp $ */ /* $NetBSD: dirent.h,v 1.9 1995/03/26 20:13:37 jtc Exp $ */ /*- @@ -97,6 +97,9 @@ typedef void * DIR; #ifndef _KERNEL __BEGIN_DECLS DIR *opendir(const char *); +#if __POSIX_VISIBLE >= 200809 +DIR *fdopendir(int); +#endif struct dirent *readdir(DIR *); void rewinddir(DIR *); int closedir(DIR *); diff --git a/src/include/stdio.h b/src/include/stdio.h index 5304e552..c0689455 100644 --- a/src/include/stdio.h +++ b/src/include/stdio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdio.h,v 1.40 2011/07/03 18:51:01 jsg Exp $ */ +/* $OpenBSD: stdio.h,v 1.41 2011/07/18 17:29:49 matthew Exp $ */ /* $NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $ */ /*- @@ -251,6 +251,9 @@ int putchar(int); int puts(const char *); int remove(const char *); int rename(const char *, const char *); +#if __POSIX_VISIBLE >= 200809 +int renameat(int, const char *, int, const char *); +#endif void rewind(FILE *); int scanf(const char *, ...); void setbuf(FILE *, char *); diff --git a/src/include/unistd.h b/src/include/unistd.h index 92d91a79..3c27f525 100644 --- a/src/include/unistd.h +++ b/src/include/unistd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: unistd.h,v 1.64 2011/07/03 18:51:01 jsg Exp $ */ +/* $OpenBSD: unistd.h,v 1.65 2011/07/18 17:29:49 matthew Exp $ */ /* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */ /*- @@ -203,6 +203,15 @@ int setegid(gid_t); int seteuid(uid_t); #endif +#if __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); +ssize_t readlinkat(int, const char *, char *, size_t); +int symlinkat(const char *, int, const char *); +int unlinkat(int, const char *, int); +#endif + #if __BSD_VISIBLE int acct(const char *); int closefrom(int);