From f51275eedbb56061b0301e901046f7d0f5aad20f Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 6 Jun 2015 06:19:07 +0200 Subject: 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 --- include/c.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/c.h') 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 -- cgit v1.2.3-55-g7522