cregit-Linux how code gets into the kernel

Release 4.16 include/linux/eventfd.h

Directory: include/linux
/* SPDX-License-Identifier: GPL-2.0 */
/*
 *  include/linux/eventfd.h
 *
 *  Copyright (C) 2007  Davide Libenzi <davidel@xmailserver.org>
 *
 */

#ifndef _LINUX_EVENTFD_H

#define _LINUX_EVENTFD_H

#include <linux/fcntl.h>
#include <linux/wait.h>

/*
 * CAREFUL: Check include/uapi/asm-generic/fcntl.h when defining
 * new flags, since they might collide with O_* ones. We want
 * to re-use O_* flags that couldn't possibly have a meaning
 * 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)

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);
__u64 eventfd_signal(struct eventfd_ctx *ctx, __u64 n);
int eventfd_ctx_remove_wait_queue(struct eventfd_ctx *ctx, wait_queue_entry_t *wait,
				  __u64 *cnt);

#else /* CONFIG_EVENTFD */

/*
 * Ugly ugly ugly error layer to support modules that uses eventfd but
 * pretend to work in !CONFIG_EVENTFD configurations. Namely, AIO.
 */


static inline struct eventfd_ctx *eventfd_ctx_fdget(int fd) { return ERR_PTR(-ENOSYS); }

Contributors

PersonTokensPropCommitsCommitProp
Davide Libenzi19100.00%2100.00%
Total19100.00%2100.00%


static inline int eventfd_signal(struct eventfd_ctx *ctx, int n) { return -ENOSYS; }

Contributors

PersonTokensPropCommitsCommitProp
Randy Dunlap1052.63%133.33%
Davide Libenzi947.37%266.67%
Total19100.00%3100.00%


static inline void eventfd_ctx_put(struct eventfd_ctx *ctx) { }

Contributors

PersonTokensPropCommitsCommitProp
Davide Libenzi11100.00%1100.00%
Total11100.00%1100.00%


static inline int eventfd_ctx_remove_wait_queue(struct eventfd_ctx *ctx, wait_queue_entry_t *wait, __u64 *cnt) { return -ENOSYS; }

Contributors

PersonTokensPropCommitsCommitProp
Davide Libenzi2395.83%150.00%
Ingo Molnar14.17%150.00%
Total24100.00%2100.00%

#endif #endif /* _LINUX_EVENTFD_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
Davide Libenzi16082.90%430.77%
Ulrich Drepper115.70%215.38%
Randy Dunlap105.18%17.69%
Eric Biggers31.55%17.69%
Al Viro31.55%17.69%
Ingo Molnar21.04%17.69%
Sha Zhengju21.04%17.69%
Greg Kroah-Hartman10.52%17.69%
Martin Sustrik10.52%17.69%
Total193100.00%13100.00%
Directory: include/linux
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.