| 
									
										
										
										
											2011-08-26 00:37:52 -04:00
										 |  |  | ! Copyright (C) 2008, 2011 Slava Pestov. | 
					
						
							| 
									
										
										
										
											2008-01-20 17:06:38 -05:00
										 |  |  | ! See http://factorcode.org/license.txt for BSD license. | 
					
						
							|  |  |  | IN: unix.linux.epoll | 
					
						
							| 
									
										
										
										
											2011-08-26 00:37:52 -04:00
										 |  |  | USING: alien.c-types alien.syntax classes.struct math | 
					
						
							|  |  |  | unix.types ;
 | 
					
						
							| 
									
										
										
										
											2008-01-20 17:06:38 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-19 19:54:27 -04:00
										 |  |  | FUNCTION: int epoll_create ( int size ) | 
					
						
							| 
									
										
										
										
											2008-01-20 17:06:38 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-05-15 01:11:12 -04:00
										 |  |  | UNION-STRUCT: epoll-data | 
					
						
							|  |  |  |     { ptr void*    } | 
					
						
							|  |  |  |     { fd  int      } | 
					
						
							|  |  |  |     { u32 uint32_t } | 
					
						
							|  |  |  |     { u64 uint64_t } ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-26 00:37:52 -04:00
										 |  |  | PACKED-STRUCT: epoll-event | 
					
						
							| 
									
										
										
										
											2011-05-15 01:11:12 -04:00
										 |  |  |     { events uint32_t   } | 
					
						
							|  |  |  |     { data   epoll-data } ;
 | 
					
						
							| 
									
										
										
										
											2008-01-20 17:06:38 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-19 19:54:27 -04:00
										 |  |  | FUNCTION: int epoll_ctl ( int epfd, int op, int fd, epoll-event* event ) | 
					
						
							| 
									
										
										
										
											2009-09-28 05:26:05 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-19 19:54:27 -04:00
										 |  |  | FUNCTION: int epoll_wait ( int epfd, epoll-event* events, int maxevents, int timeout ) | 
					
						
							| 
									
										
										
										
											2008-01-20 17:06:38 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-16 02:12:36 -05:00
										 |  |  | 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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-23 21:49:33 -05:00
										 |  |  | CONSTANT: EPOLLIN      0x001
 | 
					
						
							|  |  |  | CONSTANT: EPOLLPRI     0x002
 | 
					
						
							|  |  |  | CONSTANT: EPOLLOUT     0x004
 | 
					
						
							|  |  |  | CONSTANT: EPOLLRDNORM  0x040
 | 
					
						
							|  |  |  | CONSTANT: EPOLLRDBAND  0x080
 | 
					
						
							|  |  |  | CONSTANT: EPOLLWRNORM  0x100
 | 
					
						
							|  |  |  | CONSTANT: EPOLLWRBAND  0x200
 | 
					
						
							|  |  |  | CONSTANT: EPOLLMSG     0x400
 | 
					
						
							|  |  |  | CONSTANT: EPOLLERR     0x008
 | 
					
						
							|  |  |  | CONSTANT: EPOLLHUP     0x010
 | 
					
						
							|  |  |  | CONSTANT: EPOLLRDHUP   0x2000
 | 
					
						
							| 
									
										
										
										
											2008-12-16 03:03:04 -05:00
										 |  |  | : EPOLLONESHOT ( -- n ) 30 2^ ; inline
 | 
					
						
							|  |  |  | : EPOLLET      ( -- n ) 31 2^ ; inline
 |