1 ! Copyright (C) 2008, 2011 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
4 USING: alien.c-types alien.syntax classes.struct math
7 FUNCTION: int epoll_create ( int size )
9 UNION-STRUCT: epoll-data
15 PACKED-STRUCT: epoll-event
19 FUNCTION: int epoll_ctl ( int epfd, int op, int fd, epoll-event* event )
21 FUNCTION: int epoll_wait ( int epfd, epoll-event* events, int maxevents, int timeout )
23 CONSTANT: EPOLL_CTL_ADD 1 ! Add a file decriptor to the interface.
24 CONSTANT: EPOLL_CTL_DEL 2 ! Remove a file decriptor from the interface.
25 CONSTANT: EPOLL_CTL_MOD 3 ! Change file decriptor epoll_event structure.
27 CONSTANT: EPOLLIN 0x001
28 CONSTANT: EPOLLPRI 0x002
29 CONSTANT: EPOLLOUT 0x004
30 CONSTANT: EPOLLRDNORM 0x040
31 CONSTANT: EPOLLRDBAND 0x080
32 CONSTANT: EPOLLWRNORM 0x100
33 CONSTANT: EPOLLWRBAND 0x200
34 CONSTANT: EPOLLMSG 0x400
35 CONSTANT: EPOLLERR 0x008
36 CONSTANT: EPOLLHUP 0x010
37 CONSTANT: EPOLLRDHUP 0x2000
38 : EPOLLONESHOT ( -- n ) 30 2^ ; inline
39 : EPOLLET ( -- n ) 31 2^ ; inline