]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
include/c: Define F_DUPFD_CLOEXEC on kFreeBSD systems if missing
authorGuillem Jover <guillem@hadrons.org>
Sat, 6 Jun 2015 04:19:07 +0000 (06:19 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 8 Jun 2015 10:10:04 +0000 (12:10 +0200)
The kernel of FreeBSD version 10 and higher supports this fcntl command,
but the system libc, in this case glibc, might not yet know about it.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
include/c.h

index a72e2641c4113a1752a0dba730950fdb9500623b..1eda75f6b48f3bfb7998bf6b0ca90afab7dc30c3 100644 (file)
@@ -231,6 +231,12 @@ static inline int dirfd(DIR *d)
 #define O_CLOEXEC 0
 #endif
 
+#ifdef __FreeBSD_kernel__
+#ifndef F_DUPFD_CLOEXEC
+#define F_DUPFD_CLOEXEC        17      /* Like F_DUPFD, but FD_CLOEXEC is set */
+#endif
+#endif
+
 
 #ifndef AI_ADDRCONFIG
 #define AI_ADDRCONFIG 0x0020