[RFC PATCH 2/3] epoll: add struct epoll & ioctl() commands

2014-02-02 Thread Nathaniel Yazdani
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 
---
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)
 {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RFC PATCH 2/3] epoll: add struct epoll ioctl() commands

2014-02-02 Thread Nathaniel Yazdani
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@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)
 {
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/