Include headers required for use of DIR and struct stat.
authorJim Meyering <jim@meyering.net>
Wed, 19 Jan 2005 09:57:49 +0000 (09:57 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 19 Jan 2005 09:57:49 +0000 (09:57 +0000)
[AT_SYMLINK_NOFOLLOW]: Define.
(fdopendir, fstatat): Add prototypes.

lib/openat.h

index 74f5508..43aa70f 100644 (file)
 # include <fcntl.h>
 #endif
 
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <dirent.h>
+#include <unistd.h>
+
 #ifndef AT_FDCWD
 # define AT_FDCWD (-3041965) /* same value as Solaris 9 */
 
+enum
+{
+  /* FIXME: use same value Solaris uses */
+  AT_SYMLINK_NOFOLLOW = 100
+};
+
 # ifdef __OPENAT_PREFIX
 #  undef openat
 #  define __OPENAT_CONCAT(x, y) x ## y
 #  define __OPENAT_ID(y) __OPENAT_XCONCAT (__OPENAT_PREFIX, y)
 #  define openat __OPENAT_ID (openat)
 int openat (int fd, char const *filename, int flags, /* mode_t mode */ ...);
+#  define fdopendir __OPENAT_ID (fdopendir)
+DIR *fdopendir (int fd);
+#  define fstatat __OPENAT_ID (fstatat)
+int fstatat (int fd, char const *filename, struct stat *st, int flag);
 # endif
+
 #endif