* lib/fcntl_.h: Prefer #include_next <foo.h> to #include
[pspp] / lib / fcntl_.h
index a701bcd7b0fbb4609e038eb659d9ed929a905679..98e13720052217afddba75bc6db420ae39be5b1f 100644 (file)
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
-#include @ABSOLUTE_FCNTL_H@
+#if @HAVE_INCLUDE_NEXT@
+# include_next <fcntl.h>
+#else
+# include @ABSOLUTE_FCNTL_H@
+#endif
+
+
+/* Declare overridden functions.  */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef FCHDIR_REPLACEMENT
+# define open rpl_open
+extern int open (const char *, int, ...);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* Fix up the O_* macros.  */
 
 #if !defined O_DIRECT && defined O_DIRECTIO
 /* Tru64 spells it `O_DIRECTIO'.  */
@@ -59,9 +82,6 @@
 # define O_NOCTTY 0
 #endif
 
-#ifdef O_NOFOLLOW_IS_INEFFECTIVE
-# undef O_NOFOLLOW
-#endif
 #ifndef O_NOFOLLOW
 # define O_NOFOLLOW 0
 #endif