eventfd: add a uapi header for eventfd userspace APIs
PATCH v3 1/1 eventfd: add a uapi header for eventfd userspace APIs
From: Wen Yang <[email protected]>
Create a uapi header include/uapi/linux/eventfd.h, move the associated flags to the uapi header, and include it from linux/eventfd.h.
---
v3: remove types.h that is not needed now
v2: improve the code based on Christian's suggestions
include/linux/eventfd.h | 6 +----- include/uapi/linux/eventfd.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 include/uapi/linux/eventfd.h
include/linux/eventfd.h +1 -5
@@ -9,12 +9,12 @@#ifndef _LINUX_EVENTFD_H#define _LINUX_EVENTFD_H -#include <linux/fcntl.h> #include <linux/wait.h> #include <linux/err.h> #include <linux/percpu-defs.h> #include <linux/percpu.h> #include <linux/sched.h> +#include <uapi/linux/eventfd.h> /* * CAREFUL: Check include/uapi/asm-generic/fcntl.h when defining
@@ -23,10 +23,6 @@* from eventfd, in order to leave a free define-space for * shared O_* flags. */ -#define EFD_SEMAPHORE (1 << 0) -#define EFD_CLOEXEC O_CLOEXEC -#define EFD_NONBLOCK O_NONBLOCK -#define EFD_SHARED_FCNTL_FLAGS (O_CLOEXEC | O_NONBLOCK)#define EFD_FLAGS_SET (EFD_SHARED_FCNTL_FLAGS | EFD_SEMAPHORE)
include/uapi/linux/eventfd.h new file +11 -0
@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef _UAPI_LINUX_EVENTFD_H +#define _UAPI_LINUX_EVENTFD_H + +#include <linux/fcntl.h> + +#define EFD_SEMAPHORE (1 << 0) +#define EFD_CLOEXEC O_CLOEXEC +#define EFD_NONBLOCK O_NONBLOCK + +#endif /* _UAPI_LINUX_EVENTFD_H */
Signature · 1 line
2.25.1
Quoted 7 lines · On Thu, Jun 15, 2023 at 02:40:28AM +0800, [email protected] wrote:
From: Wen Yang <[email protected]>
Create a uapi header
include/uapi/linux/eventfd.h, move the associated flags to the uapi header, and include it fromlinux/eventfd.h.Suggested-by Christian Brauner <[email protected]>Signed-off-by Wen Yang <[email protected]>
Quoted 4 lines · On Thu, 15 Jun 2023 02:40:28 +0800, [email protected] wrote:
Create a uapi header
include/uapi/linux/eventfd.h, move the associated flags to the uapi header, and include it fromlinux/eventfd.h.
Applied to the vfs.misc branch of the vfs/vfs.git tree. Patches in the vfs.misc branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.misc
[1/1] eventfd: add a uapi header for eventfd userspace APIs
https://git.kernel.org/vfs/vfs/c/3e3a566392e2