From 240f6615db2c65a98b2c9bd41939990c6dfdd572 Mon Sep 17 00:00:00 2001 From: Todd Poynor Date: Wed, 8 May 2013 19:28:59 -0700 Subject: Add timerfd syscall support From kernel v3.9 commit 9ec2690758a5467f24beb301cca5098078073bba timerfd: Manage cancelable timers in timerfd (cherry-pick of 60279f2b8c15aff1a0716a3046f3b619452c734d.) Change-Id: Ieb81c5891adfacf6637e0874f6d91e681e6dab63 --- original/linux/timerfd.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 original/linux/timerfd.h (limited to 'original') diff --git a/original/linux/timerfd.h b/original/linux/timerfd.h new file mode 100644 index 0000000..d3b57fa --- /dev/null +++ b/original/linux/timerfd.h @@ -0,0 +1,32 @@ +/* + * include/linux/timerfd.h + * + * Copyright (C) 2007 Davide Libenzi + * + */ + +#ifndef _LINUX_TIMERFD_H +#define _LINUX_TIMERFD_H + +/* For O_CLOEXEC and O_NONBLOCK */ +#include + +/* + * CAREFUL: Check include/asm-generic/fcntl.h when defining + * new flags, since they might collide with O_* ones. We want + * to re-use O_* flags that couldn't possibly have a meaning + * from eventfd, in order to leave a free define-space for + * shared O_* flags. + */ +#define TFD_TIMER_ABSTIME (1 << 0) +#define TFD_TIMER_CANCEL_ON_SET (1 << 1) +#define TFD_CLOEXEC O_CLOEXEC +#define TFD_NONBLOCK O_NONBLOCK + +#define TFD_SHARED_FCNTL_FLAGS (TFD_CLOEXEC | TFD_NONBLOCK) +/* Flags for timerfd_create. */ +#define TFD_CREATE_FLAGS TFD_SHARED_FCNTL_FLAGS +/* Flags for timerfd_settime. */ +#define TFD_SETTIME_FLAGS (TFD_TIMER_ABSTIME | TFD_TIMER_CANCEL_ON_SET) + +#endif /* _LINUX_TIMERFD_H */ -- cgit v1.2.3