summaryrefslogtreecommitdiff
path: root/gnulib/lib/openat.h
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2012-02-01 23:46:33 +0000
committerColin Watson <cjwatson@debian.org>2012-02-01 23:46:33 +0000
commit8410a03575f1a8550498f3d0b4ea51ff72edd780 (patch)
tree98b88fbce129cb9c69e3461394ead94c12731466 /gnulib/lib/openat.h
parent91c495389105a4cb6214fe176f703f498e4f0d91 (diff)
Upgrade to Automake 1.11.2 and Gnulib 20111211-stable.
* gnulib: Import closedir, fstat, and opendir modules.
Diffstat (limited to 'gnulib/lib/openat.h')
-rw-r--r--gnulib/lib/openat.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/gnulib/lib/openat.h b/gnulib/lib/openat.h
index fb4f4d8b..eae86ceb 100644
--- a/gnulib/lib/openat.h
+++ b/gnulib/lib/openat.h
@@ -19,13 +19,10 @@
#ifndef _GL_HEADER_OPENAT
#define _GL_HEADER_OPENAT
-/* Write "fcntl.h" here, not <fcntl.h>, otherwise OSF/1 5.1 DTK cc miscompiles
- openat.c because that file has a preliminary #include <fcntl.h>. */
-#include "fcntl.h"
+#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <dirent.h>
#include <unistd.h>
#include <stdbool.h>
@@ -49,6 +46,9 @@ _Noreturn void openat_save_fail (int);
/* Using these function names makes application code
slightly more readable than it would be with
fchownat (..., 0) or fchownat (..., AT_SYMLINK_NOFOLLOW). */
+
+#if GNULIB_FCHOWNAT
+
static inline int
chownat (int fd, char const *file, uid_t owner, gid_t group)
{
@@ -61,6 +61,10 @@ lchownat (int fd, char const *file, uid_t owner, gid_t group)
return fchownat (fd, file, owner, group, AT_SYMLINK_NOFOLLOW);
}
+#endif
+
+#if GNULIB_FCHMODAT
+
static inline int
chmodat (int fd, char const *file, mode_t mode)
{
@@ -73,6 +77,10 @@ lchmodat (int fd, char const *file, mode_t mode)
return fchmodat (fd, file, mode, AT_SYMLINK_NOFOLLOW);
}
+#endif
+
+#if GNULIB_FSTATAT
+
static inline int
statat (int fd, char const *name, struct stat *st)
{
@@ -85,6 +93,8 @@ lstatat (int fd, char const *name, struct stat *st)
return fstatat (fd, name, st, AT_SYMLINK_NOFOLLOW);
}
+#endif
+
/* For now, there are no wrappers named laccessat or leuidaccessat,
since gnulib doesn't support faccessat(,AT_SYMLINK_NOFOLLOW) and
since access rights on symlinks are of limited utility. Likewise,