factor/basis/unix/linux/epoll/epoll.factor

33 lines
1.0 KiB
Factor
Raw Normal View History

2008-01-20 17:06:38 -05:00
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
IN: unix.linux.epoll
USING: alien.syntax math ;
2008-01-20 17:06:38 -05:00
FUNCTION: int epoll_create ( int size ) ;
FUNCTION: int epoll_ctl ( int epfd, int op, int fd, epoll_event* event ) ;
C-STRUCT: epoll-event
{ "uint" "events" }
2008-01-23 03:07:15 -05:00
{ "uint" "fd" }
{ "uint" "padding" } ;
2008-01-20 17:06:38 -05:00
FUNCTION: int epoll_wait ( int epfd, epoll_event* events, int maxevents, int timeout ) ;
CONSTANT: EPOLL_CTL_ADD 1 ! Add a file decriptor to the interface.
CONSTANT: EPOLL_CTL_DEL 2 ! Remove a file decriptor from the interface.
CONSTANT: EPOLL_CTL_MOD 3 ! Change file decriptor epoll_event structure.
2008-01-20 17:06:38 -05:00
CONSTANT: EPOLLIN HEX: 001
CONSTANT: EPOLLPRI HEX: 002
CONSTANT: EPOLLOUT HEX: 004
CONSTANT: EPOLLRDNORM HEX: 040
CONSTANT: EPOLLRDBAND HEX: 080
CONSTANT: EPOLLWRNORM HEX: 100
CONSTANT: EPOLLWRBAND HEX: 200
CONSTANT: EPOLLMSG HEX: 400
CONSTANT: EPOLLERR HEX: 008
CONSTANT: EPOLLHUP HEX: 010
2008-12-16 03:03:04 -05:00
: EPOLLONESHOT ( -- n ) 30 2^ ; inline
: EPOLLET ( -- n ) 31 2^ ; inline