diff --git a/sys/compat/linux/linux_event.h b/sys/compat/linux/linux_event.h --- a/sys/compat/linux/linux_event.h +++ b/sys/compat/linux/linux_event.h @@ -56,4 +56,7 @@ #define LINUX_EFD_SEMAPHORE (1 << 0) +#define LINUX_TFD_CLOEXEC LINUX_O_CLOEXEC +#define LINUX_TFD_NONBLOCK LINUX_O_NONBLOCK + #endif /* !_LINUX_EVENT_H_ */ diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -693,12 +693,18 @@ { clockid_t clockid; int error; + int fflags = 0; error = linux_to_native_clockid(&clockid, args->clockid); if (error != 0) return (error); - return (kern_timerfd_create(td, clockid, args->flags)); + if ((args->flags & LINUX_TFD_CLOEXEC) != 0) + fflags |= O_CLOEXEC; + if ((args->flags & LINUX_TFD_NONBLOCK) != 0) + fflags |= TFD_NONBLOCK; + + return (kern_timerfd_create(td, clockid, fflags)); } int