Expose full epoll_ctl functionality.
authorAndrius Bentkus <andrius.bentkus@gmail.com>
Fri, 2 May 2014 14:18:45 +0000 (16:18 +0200)
committerAndrius Bentkus <andrius.bentkus@gmail.com>
Wed, 18 Jun 2014 15:06:44 +0000 (18:06 +0300)
Now the user has access to all struct elements in EpollEvent when
using epoll_ctl. This is in particular very intersting when the
user wants to access the ptr field.

The user can use GCHandle.ToIntPtr to give the struct a GCHandle
and then handle the pointer later on when using epoll_wait.

mcs/class/Mono.Posix/Mono.Unix.Native/Syscall.cs

index 7ba53e922bf7d1dd53db2206246a8281c522af7c..0b8f1e6fa028cea47e904a1fbb9ce1a061dbc9c7 100644 (file)
@@ -2842,7 +2842,7 @@ namespace Mono.Unix.Native {
                        ee.events = events;
                        ee.fd = fd;
 
-                       return sys_epoll_ctl (epfd, op, fd, ref ee);
+                       return epoll_ctl (epfd, op, fd, ref ee);
                }
 
                public static int epoll_wait (int epfd, EpollEvent [] events, int max_events, int timeout)
@@ -2860,7 +2860,7 @@ namespace Mono.Unix.Native {
                private static extern int sys_epoll_create1 (EpollFlags flags);
 
                [DllImport (LIBC, SetLastError=true, EntryPoint="epoll_ctl")]
-               private static extern int sys_epoll_ctl (int epfd, EpollOp op, int fd, ref EpollEvent ee);
+               public static extern int epoll_ctl (int epfd, EpollOp op, int fd, ref EpollEvent ee);
 
                [DllImport (LIBC, SetLastError=true, EntryPoint="epoll_wait")]
                private static extern int sys_epoll_wait (int epfd, EpollEvent [] ee, int maxevents, int timeout);