blob: a667637b54e3912783c9f1e086c57df74784e05b [file] [log] [blame]
Davide Libenzie1ad7462007-05-10 22:23:19 -07001/*
2 * include/linux/eventfd.h
3 *
4 * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org>
5 *
6 */
7
8#ifndef _LINUX_EVENTFD_H
9#define _LINUX_EVENTFD_H
10
Davide Libenzie1ad7462007-05-10 22:23:19 -070011#ifdef CONFIG_EVENTFD
12
Ulrich Dreppere7d476d2008-07-23 21:29:38 -070013/* For O_CLOEXEC and O_NONBLOCK */
Ulrich Drepperb087498e2008-07-23 21:29:25 -070014#include <linux/fcntl.h>
15
16/* Flags for eventfd2. */
17#define EFD_CLOEXEC O_CLOEXEC
Ulrich Dreppere7d476d2008-07-23 21:29:38 -070018#define EFD_NONBLOCK O_NONBLOCK
Ulrich Drepperb087498e2008-07-23 21:29:25 -070019
Davide Libenzie1ad7462007-05-10 22:23:19 -070020struct file *eventfd_fget(int fd);
21int eventfd_signal(struct file *file, int n);
22
23#else /* CONFIG_EVENTFD */
24
25#define eventfd_fget(fd) ERR_PTR(-ENOSYS)
Randy Dunlapd2fd8992007-06-27 14:09:48 -070026static inline int eventfd_signal(struct file *file, int n)
27{ return 0; }
Davide Libenzie1ad7462007-05-10 22:23:19 -070028
29#endif /* CONFIG_EVENTFD */
30
Davide Libenzie1ad7462007-05-10 22:23:19 -070031#endif /* _LINUX_EVENTFD_H */
32