Skip to content

Commit 2d8c9dc

Browse files
tasksetbrauner
authored andcommitted
eventfd: add a uapi header for eventfd userspace APIs
Create a uapi header include/uapi/linux/eventfd.h, move the associated flags to the uapi header, and include it from linux/eventfd.h. Suggested-by: Christian Brauner <[email protected]> Signed-off-by: Wen Yang <[email protected]> Reviewed-by: Matthew Wilcox (Oracle) <[email protected]> Cc: Alexander Viro <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Christian Brauner <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Dylan Yudaken <[email protected]> Cc: David Woodhouse <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Eric Biggers <[email protected]> Cc: [email protected] Cc: [email protected] Message-Id: <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 797a1d8 commit 2d8c9dc

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

include/linux/eventfd.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
#ifndef _LINUX_EVENTFD_H
1010
#define _LINUX_EVENTFD_H
1111

12-
#include <linux/fcntl.h>
1312
#include <linux/wait.h>
1413
#include <linux/err.h>
1514
#include <linux/percpu-defs.h>
1615
#include <linux/percpu.h>
1716
#include <linux/sched.h>
17+
#include <uapi/linux/eventfd.h>
1818

1919
/*
2020
* CAREFUL: Check include/uapi/asm-generic/fcntl.h when defining
@@ -23,10 +23,6 @@
2323
* from eventfd, in order to leave a free define-space for
2424
* shared O_* flags.
2525
*/
26-
#define EFD_SEMAPHORE (1 << 0)
27-
#define EFD_CLOEXEC O_CLOEXEC
28-
#define EFD_NONBLOCK O_NONBLOCK
29-
3026
#define EFD_SHARED_FCNTL_FLAGS (O_CLOEXEC | O_NONBLOCK)
3127
#define EFD_FLAGS_SET (EFD_SHARED_FCNTL_FLAGS | EFD_SEMAPHORE)
3228

include/uapi/linux/eventfd.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2+
#ifndef _UAPI_LINUX_EVENTFD_H
3+
#define _UAPI_LINUX_EVENTFD_H
4+
5+
#include <linux/fcntl.h>
6+
7+
#define EFD_SEMAPHORE (1 << 0)
8+
#define EFD_CLOEXEC O_CLOEXEC
9+
#define EFD_NONBLOCK O_NONBLOCK
10+
11+
#endif /* _UAPI_LINUX_EVENTFD_H */

0 commit comments

Comments
 (0)