--- coregrind/m_syswrap/syswrap-freebsd.c 2013-05-06 10:12:54.000000000 -0700 +++ coregrind/m_syswrap/syswrap-freebsd.c 2015-01-02 11:57:57.000000000 -0800 @@ -3242,6 +3242,7 @@ case VKI_F_SETFD: case VKI_F_SETFL: case VKI_F_SETOWN: + case VKI_F_DUPFD_CLOEXEC: PRINT("sys_fcntl[ARG3=='arg'] ( %ld, %ld, %ld )", ARG1,ARG2,ARG3); PRE_REG_READ3(long, "fcntl", unsigned int, fd, unsigned int, cmd, unsigned long, arg); @@ -3291,7 +3292,7 @@ POST(sys_fcntl) { vg_assert(SUCCESS); - if (ARG2 == VKI_F_DUPFD) { + if (ARG2 == VKI_F_DUPFD || ARG2 == VKI_F_DUPFD_CLOEXEC) { if (!ML_(fd_allowed)(RES, "fcntl(DUPFD)", tid, True)) { VG_(close)(RES); SET_STATUS_Failure( VKI_EMFILE ); --- include/vki/vki-freebsd.h 2013-05-06 10:12:55.000000000 -0700 +++ include/vki/vki-freebsd.h 2015-01-02 11:55:59.000000000 -0800 @@ -1543,6 +1543,7 @@ #define VKI_F_SETLK 12 /* set record locking information */ #define VKI_F_SETLKW 13 /* F_SETLK; wait if blocked */ #define VKI_F_SETLK_REMOTE 14 /* debugging support for remote locks */ +#define VKI_F_DUPFD_CLOEXEC 17 /* Like F_DUPFD, but FD_CLOEXEC is set */ /* for F_[GET|SET]FL */ #define VKI_FD_CLOEXEC 1 /* actually anything with low bit set goes */