Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Wen Yang and committed by
Christian Brauner
2d8c9dcf 797a1d89

+12 -5
+1 -5
include/linux/eventfd.h
··· 9 9 #ifndef _LINUX_EVENTFD_H 10 10 #define _LINUX_EVENTFD_H 11 11 12 - #include <linux/fcntl.h> 13 12 #include <linux/wait.h> 14 13 #include <linux/err.h> 15 14 #include <linux/percpu-defs.h> 16 15 #include <linux/percpu.h> 17 16 #include <linux/sched.h> 17 + #include <uapi/linux/eventfd.h> 18 18 19 19 /* 20 20 * CAREFUL: Check include/uapi/asm-generic/fcntl.h when defining ··· 23 23 * from eventfd, in order to leave a free define-space for 24 24 * shared O_* flags. 25 25 */ 26 - #define EFD_SEMAPHORE (1 << 0) 27 - #define EFD_CLOEXEC O_CLOEXEC 28 - #define EFD_NONBLOCK O_NONBLOCK 29 - 30 26 #define EFD_SHARED_FCNTL_FLAGS (O_CLOEXEC | O_NONBLOCK) 31 27 #define EFD_FLAGS_SET (EFD_SHARED_FCNTL_FLAGS | EFD_SEMAPHORE) 32 28
+11
include/uapi/linux/eventfd.h
··· 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 */