diff --git a/sys/kern/sys_timerfd.c b/sys/kern/sys_timerfd.c index 30c3709e59a6..f74fb87bea75 100644 --- a/sys/kern/sys_timerfd.c +++ b/sys/kern/sys_timerfd.c @@ -26,6 +26,7 @@ * SUCH DAMAGE. */ +#include #include #include #include @@ -432,8 +433,18 @@ kern_timerfd_create(struct thread *td, int clockid, int flags) AUDIT_ARG_VALUE(clockid); AUDIT_ARG_FFLAGS(flags); - if (clockid != CLOCK_REALTIME && clockid != CLOCK_MONOTONIC) + switch (clockid) { + case CLOCK_REALTIME: + /* FALLTHROUGH */ + case CLOCK_MONOTONIC: + /* FALLTHROUGH */ + case CLOCK_UPTIME: + /* FALLTHROUGH */ + case CLOCK_BOOTTIME: + break; + default: return (EINVAL); + } if ((flags & ~(TFD_CLOEXEC | TFD_NONBLOCK)) != 0) return (EINVAL);