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 <brauner@kernel.org> Signed-off-by: Wen Yang <wenyang.linux@foxmail.com> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Jens Axboe <axboe@kernel.dk> Cc: Christian Brauner <brauner@kernel.org> Cc: Christoph Hellwig <hch@lst.de> Cc: Dylan Yudaken <dylany@fb.com> Cc: David Woodhouse <dwmw@amazon.co.uk> Cc: Matthew Wilcox <willy@infradead.org> Cc: Eric Biggers <ebiggers@google.com> Cc: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Message-Id: <tencent_2B6A999A23E86E522D5D9859D54FFCF9AA05@qq.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 797a1d8 commit 2d8c9dc

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

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)