aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger2017-01-10 18:58:30 -0600
committerLinus Torvalds2017-01-10 20:31:55 -0600
commit575b1967e10a1f3038266244d2c7a3ca6b99fed8 (patch)
treeafc6b9ae578378b122cfdbd910bd09aef81f2f82
parente5bbc8a6c992901058bc09e2ce01d16c111ff047 (diff)
downloadmkaricheri-ti-linux-kernel-575b1967e10a1f3038266244d2c7a3ca6b99fed8.tar.gz
mkaricheri-ti-linux-kernel-575b1967e10a1f3038266244d2c7a3ca6b99fed8.tar.xz
mkaricheri-ti-linux-kernel-575b1967e10a1f3038266244d2c7a3ca6b99fed8.zip
timerfd: export defines to userspace
Since userspace is expected to call timerfd syscalls directly with these flags/ioctls, make sure we export them so they don't have to duplicate the values themselves. Link: http://lkml.kernel.org/r/20161219064052.7196-1-vapier@gentoo.org Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/timerfd.h20
-rw-r--r--include/uapi/linux/Kbuild1
-rw-r--r--include/uapi/linux/timerfd.h36
3 files changed, 38 insertions, 19 deletions
diff --git a/include/linux/timerfd.h b/include/linux/timerfd.h
index bd36ce431e32..bab0b1ad0613 100644
--- a/include/linux/timerfd.h
+++ b/include/linux/timerfd.h
@@ -8,23 +8,7 @@
8#ifndef _LINUX_TIMERFD_H 8#ifndef _LINUX_TIMERFD_H
9#define _LINUX_TIMERFD_H 9#define _LINUX_TIMERFD_H
10 10
11/* For O_CLOEXEC and O_NONBLOCK */ 11#include <uapi/linux/timerfd.h>
12#include <linux/fcntl.h>
13
14/* For _IO helpers */
15#include <linux/ioctl.h>
16
17/*
18 * CAREFUL: Check include/asm-generic/fcntl.h when defining
19 * new flags, since they might collide with O_* ones. We want
20 * to re-use O_* flags that couldn't possibly have a meaning
21 * from eventfd, in order to leave a free define-space for
22 * shared O_* flags.
23 */
24#define TFD_TIMER_ABSTIME (1 << 0)
25#define TFD_TIMER_CANCEL_ON_SET (1 << 1)
26#define TFD_CLOEXEC O_CLOEXEC
27#define TFD_NONBLOCK O_NONBLOCK
28 12
29#define TFD_SHARED_FCNTL_FLAGS (TFD_CLOEXEC | TFD_NONBLOCK) 13#define TFD_SHARED_FCNTL_FLAGS (TFD_CLOEXEC | TFD_NONBLOCK)
30/* Flags for timerfd_create. */ 14/* Flags for timerfd_create. */
@@ -32,6 +16,4 @@
32/* Flags for timerfd_settime. */ 16/* Flags for timerfd_settime. */
33#define TFD_SETTIME_FLAGS (TFD_TIMER_ABSTIME | TFD_TIMER_CANCEL_ON_SET) 17#define TFD_SETTIME_FLAGS (TFD_TIMER_ABSTIME | TFD_TIMER_CANCEL_ON_SET)
34 18
35#define TFD_IOC_SET_TICKS _IOW('T', 0, u64)
36
37#endif /* _LINUX_TIMERFD_H */ 19#endif /* _LINUX_TIMERFD_H */
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index a8b93e685239..f330ba4547cf 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -414,6 +414,7 @@ header-y += telephony.h
414header-y += termios.h 414header-y += termios.h
415header-y += thermal.h 415header-y += thermal.h
416header-y += time.h 416header-y += time.h
417header-y += timerfd.h
417header-y += times.h 418header-y += times.h
418header-y += timex.h 419header-y += timex.h
419header-y += tiocl.h 420header-y += tiocl.h
diff --git a/include/uapi/linux/timerfd.h b/include/uapi/linux/timerfd.h
new file mode 100644
index 000000000000..6fcfaa8da173
--- /dev/null
+++ b/include/uapi/linux/timerfd.h
@@ -0,0 +1,36 @@
1/*
2 * include/linux/timerfd.h
3 *
4 * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org>
5 *
6 */
7
8#ifndef _UAPI_LINUX_TIMERFD_H
9#define _UAPI_LINUX_TIMERFD_H
10
11#include <linux/types.h>
12
13/* For O_CLOEXEC and O_NONBLOCK */
14#include <linux/fcntl.h>
15
16/* For _IO helpers */
17#include <linux/ioctl.h>
18
19/*
20 * CAREFUL: Check include/asm-generic/fcntl.h when defining
21 * new flags, since they might collide with O_* ones. We want
22 * to re-use O_* flags that couldn't possibly have a meaning
23 * from eventfd, in order to leave a free define-space for
24 * shared O_* flags.
25 *
26 * Also make sure to update the masks in include/linux/timerfd.h
27 * when adding new flags.
28 */
29#define TFD_TIMER_ABSTIME (1 << 0)
30#define TFD_TIMER_CANCEL_ON_SET (1 << 1)
31#define TFD_CLOEXEC O_CLOEXEC
32#define TFD_NONBLOCK O_NONBLOCK
33
34#define TFD_IOC_SET_TICKS _IOW('T', 0, __u64)
35
36#endif /* _UAPI_LINUX_TIMERFD_H */