#ifndef _LINUX_EVENTFD_H
#define _LINUX_EVENTFD_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>
#define EFD_SHARED_FCNTL_FLAGS …
#define EFD_FLAGS_SET …
struct eventfd_ctx;
struct file;
#ifdef CONFIG_EVENTFD
void eventfd_ctx_put(struct eventfd_ctx *ctx);
struct file *eventfd_fget(int fd);
struct eventfd_ctx *eventfd_ctx_fdget(int fd);
struct eventfd_ctx *eventfd_ctx_fileget(struct file *file);
void eventfd_signal_mask(struct eventfd_ctx *ctx, __poll_t mask);
int eventfd_ctx_remove_wait_queue(struct eventfd_ctx *ctx, wait_queue_entry_t *wait,
__u64 *cnt);
void eventfd_ctx_do_read(struct eventfd_ctx *ctx, __u64 *cnt);
static inline bool eventfd_signal_allowed(void)
{ … }
#else
static inline struct eventfd_ctx *eventfd_ctx_fdget(int fd)
{
return ERR_PTR(-ENOSYS);
}
static inline void eventfd_signal_mask(struct eventfd_ctx *ctx, __poll_t mask)
{
}
static inline void eventfd_ctx_put(struct eventfd_ctx *ctx)
{
}
static inline int eventfd_ctx_remove_wait_queue(struct eventfd_ctx *ctx,
wait_queue_entry_t *wait, __u64 *cnt)
{
return -ENOSYS;
}
static inline bool eventfd_signal_allowed(void)
{
return true;
}
static inline void eventfd_ctx_do_read(struct eventfd_ctx *ctx, __u64 *cnt)
{
}
#endif
static inline void eventfd_signal(struct eventfd_ctx *ctx)
{ … }
#endif