Browse Source

libcompat: Add compat symbol for O_NOFOLLOW

This symbol was only standardized in POSIX.1-2008, which is too recent.
Although it has been available on at least FreeBSD and Linux systems
before that, but dpkg supports other systems which might not have it.
Guillem Jover 14 years ago
parent
commit
52a1b3fd94
2 changed files with 5 additions and 0 deletions
  1. 1 0
      configure.ac
  2. 4 0
      lib/compat/compat.h

+ 1 - 0
configure.ac

@@ -85,6 +85,7 @@ DPKG_FUNC_C99_SNPRINTF
 DPKG_CHECK_DECL([offsetof], [stddef.h])
 DPKG_CHECK_DECL([offsetof], [stddef.h])
 DPKG_CHECK_DECL([WCOREDUMP], [sys/wait.h])
 DPKG_CHECK_DECL([WCOREDUMP], [sys/wait.h])
 DPKG_CHECK_DECL([TIOCNOTTY], [sys/ioctl.h])
 DPKG_CHECK_DECL([TIOCNOTTY], [sys/ioctl.h])
+DPKG_CHECK_DECL([O_NOFOLLOW], [fcntl.h])
 DPKG_CHECK_PROGNAME
 DPKG_CHECK_PROGNAME
 DPKG_CHECK_COMPAT_FUNCS([getopt getopt_long obstack_free \
 DPKG_CHECK_COMPAT_FUNCS([getopt getopt_long obstack_free \
                          strnlen strndup strerror strsignal asprintf \
                          strnlen strndup strerror strsignal asprintf \

+ 4 - 0
lib/compat/compat.h

@@ -30,6 +30,10 @@ extern "C" {
 #define offsetof(st, m) ((size_t)&((st *)NULL)->m)
 #define offsetof(st, m) ((size_t)&((st *)NULL)->m)
 #endif
 #endif
 
 
+#ifndef HAVE_O_NOFOLLOW
+#define O_NOFOLLOW 0
+#endif
+
 /*
 /*
  * Define WCOREDUMP if we don't have it already, coredumps won't be
  * Define WCOREDUMP if we don't have it already, coredumps won't be
  * detected, though.
  * detected, though.