From: Nathaniel Yazdani <n1ght.4nd.d4y@gmail.com>
To: viro@zeniv.linux.org.uk
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Nathaniel Yazdani <n1ght.4nd.d4y@gmail.com>
Subject: [RFC PATCH 2/3] epoll: add struct epoll & ioctl() commands
Date: Sun, 2 Feb 2014 18:17:11 -0800 [thread overview]
Message-ID: <1391393832-8754-3-git-send-email-n1ght.4nd.d4y@gmail.com> (raw)
In-Reply-To: <1391393832-8754-1-git-send-email-n1ght.4nd.d4y@gmail.com>
Add a new 'struct epoll' to the userspace eventpoll interface. Buffers
supplied to read() & write() calls on eventpolls are interpreted as
arrays of this structure. The new structure's only functional difference
from epoll_event is it also holds the associated file descriptor (needed
for write() to properly create events but useful information in general).
Also define the ioctl() command macros to set & get the timeout of an
eventpoll.
Signed-off-by: Nathaniel Yazdani <n1ght.4nd.d4y@gmail.com>
---
diff --git a/include/uapi/linux/eventpoll.h b/include/uapi/linux/eventpoll.h
index bc81fb2..73f817c 100644
--- a/include/uapi/linux/eventpoll.h
+++ b/include/uapi/linux/eventpoll.h
@@ -56,11 +56,21 @@
#define EPOLL_PACKED
#endif
+/* ioctl() requests */
+#define EPIOC_GETTIMEOUT _IOR('$', 0x10, int)
+#define EPIOC_SETTIMEOUT _IOW('$', 0x11, int)
+
struct epoll_event {
__u32 events;
__u64 data;
} EPOLL_PACKED;
+struct epoll {
+ int ep_fildes; /* file descriptor */
+ int ep_events; /* triggering events */
+ long long ep_ident; /* entry ID (cf. epoll_event->data) */
+} EPOLL_PACKED; /* A.K.A. "epe" for "eventpoll entry" */
+
#ifdef CONFIG_PM_SLEEP
static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev)
{
next prev parent reply other threads:[~2014-02-03 2:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-03 2:17 [RFC PATCH 0/3] epoll: read(),write(),ioctl() interface Nathaniel Yazdani
2014-02-03 2:17 ` [RFC PATCH 1/3] epoll: reserve small ioctl() space Nathaniel Yazdani
2014-02-03 2:17 ` Nathaniel Yazdani [this message]
2014-02-03 2:17 ` [RFC PATCH 3/3] epoll: add read()/write()/ioctl() operations Nathaniel Yazdani
2014-02-03 9:43 ` [RFC PATCH 0/3] epoll: read(),write(),ioctl() interface Clemens Ladisch
2014-02-03 19:34 ` Nathaniel Yazdani
2014-02-03 19:33 ` Andy Lutomirski
2014-02-03 19:42 ` Nathaniel Yazdani
2014-02-03 19:56 ` Andy Lutomirski
2014-02-03 21:51 ` Eric Wong
2014-02-03 22:06 ` Andy Lutomirski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1391393832-8754-3-git-send-email-n1ght.4nd.d4y@gmail.com \
--to=n1ght.4nd.d4y@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).