summaryrefslogtreecommitdiffstats
path: root/include/c.h
diff options
context:
space:
mode:
authorGuillem Jover2015-06-06 06:19:07 +0200
committerKarel Zak2015-06-08 12:10:04 +0200
commitf51275eedbb56061b0301e901046f7d0f5aad20f (patch)
tree29376c83770ace2a4000d2a783b11efba718aced /include/c.h
parentlib/sysfs: Use dup_fd_cloexec instead of direct call to fcntl (diff)
downloadkernel-qcow2-util-linux-f51275eedbb56061b0301e901046f7d0f5aad20f.tar.gz
kernel-qcow2-util-linux-f51275eedbb56061b0301e901046f7d0f5aad20f.tar.xz
kernel-qcow2-util-linux-f51275eedbb56061b0301e901046f7d0f5aad20f.zip
include/c: Define F_DUPFD_CLOEXEC on kFreeBSD systems if missing
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>
Diffstat (limited to 'include/c.h')
-rw-r--r--include/c.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/c.h b/include/c.h
index a72e2641c..1eda75f6b 100644
--- a/include/c.h
+++ b/include/c.h
@@ -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