summaryrefslogtreecommitdiff
path: root/lib/fcntl.in.h
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-09-19 11:16:58 -0600
committerEric Blake <ebb9@byu.net>2009-09-19 13:53:27 -0600
commit4c45e93c58de6532275c22a9153ecdfe516928ff (patch)
tree846c906d66e5fb0df6c775a08a40b3c878baeb48 /lib/fcntl.in.h
parent82bf7d1b42dc970e704f9347862594445f4a22dd (diff)
downloadgnulib-4c45e93c58de6532275c22a9153ecdfe516928ff.tar.gz
openat: fix openat bugs on Solaris 9
openat(fd,"file/",O_RDONLY) mistakenly succeeded. * lib/openat.c (rpl_openat): Work around Solaris 9 bug. * m4/openat.m4 (gl_FUNC_OPENAT): Also replace openat on Solaris. * modules/openat (Depends-on): Add open. * m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Provide new default. * modules/fcntl-h (Makefile.am): Substitute it. * lib/fcntl.in.h (openat): Declare replacement. * doc/posix-functions/openat.texi (openat): Document this. Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'lib/fcntl.in.h')
-rw-r--r--lib/fcntl.in.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h
index cadb6a1572..0ae8213e47 100644
--- a/lib/fcntl.in.h
+++ b/lib/fcntl.in.h
@@ -62,9 +62,11 @@ extern int open (const char *filename, int flags, ...);
#endif
#if @GNULIB_OPENAT@
-# if !@HAVE_OPENAT@
+# if @REPLACE_OPENAT@
# undef openat
# define openat rpl_openat
+# endif
+# if !@HAVE_OPENAT@ || @REPLACE_OPENAT@
int openat (int fd, char const *file, int flags, /* mode_t mode */ ...);
# endif
#elif defined GNULIB_POSIXCHECK