]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Linux: add epoll(7) and friends
authorMichael 'Mickey' Lauer <mickey@vanille-media.de>
Tue, 1 Mar 2011 15:20:27 +0000 (16:20 +0100)
committerMichael 'Mickey' Lauer <mickey@vanille-media.de>
Tue, 1 Mar 2011 15:21:50 +0000 (16:21 +0100)
Based on a patch by Stefano Debenedetti
Closes bug #641790

THANKS
vapi/linux.vapi

diff --git a/THANKS b/THANKS
index 088a52ab03fadac85a51e4ce14f2eacb74492e35..2a143580accdbc82608f8cf1923d1923468fc647 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -122,6 +122,7 @@ Sebastian Pölsterl
 Sebastian Spaeth
 Shawn Ferris
 Simon Wenner
+Stefano Debenedetti
 Stéphan Kochen
 Tai Chi Minh Ralph Eastwood
 Thijs Vermeir
index 93babcdc0cf83baa467bce984e92b122dafeca02..2611011d48cdf45eb08f30df690156d95cd190a4 100644 (file)
@@ -295,6 +295,55 @@ namespace Linux {
     public int eventfd_read (int fd, out uint64 value);
     public int eventfd_write (int fd, uint64 value);
 
+    /*
+     * Epoll
+     */
+    [CCode (cprefix = "EPOLL_", cheader_filename = "sys/epoll.h")]
+    public enum EpollFdFlags {
+        CLOEXEC,
+    }
+
+    [CCode (cheader_filename = "sys/epoll.h", cname = "union epoll_data")]
+    public struct EpollData {
+        public void* ptr;
+        public int fd;
+        public uint32 u32;
+        public uint64 u64;
+    }
+
+    [CCode (cheader_filename = "sys/epoll.h", cname = "struct epoll_event")]
+    public struct EpollEvent {
+        public uint32 events;
+        public EpollData data;
+    }
+
+    [CCode (cheader_filename = "sys/epoll.h")]
+    public int epoll_create (int size = 0);
+    [CCode (cheader_filename = "sys/epoll.h")]
+    public int epoll_create1 (int flags = 0);
+    [CCode (cheader_filename = "sys/epoll.h")]
+    public int epoll_wait (int epfd, EpollEvent[] events, int timeout);
+    [CCode (cheader_filename = "sys/epoll.h")]
+    public int epoll_pwait (int epfd, EpollEvent[] events, Posix.sigset_t? sigmask, int timeout);
+    [CCode (cheader_filename = "sys/epoll.h")]
+    public int epoll_ctl (int epfd, int op, int fd, EpollEvent? ev);
+    [CCode (cheader_filename = "sys/epoll.h")]
+    public const int EPOLLIN;
+    [CCode (cheader_filename = "sys/epoll.h")]
+    public const int EPOLLOUT;
+    [CCode (cheader_filename = "sys/epoll.h")]
+    public const int EPOLLERR;
+    [CCode (cheader_filename = "sys/epoll.h")]
+    public const int EPOLLHUP;
+    [CCode (cheader_filename = "sys/epoll.h")]
+    public const int EPOLLET;
+    [CCode (cheader_filename = "sys/epoll.h")]
+    public const int EPOLL_CTL_ADD;
+    [CCode (cheader_filename = "sys/epoll.h")]
+    public const int EPOLL_CTL_MOD;
+    [CCode (cheader_filename = "sys/epoll.h")]
+    public const int EPOLL_CTL_DEL;
+
     /*
      * Framebuffer
      */