1c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner/* 2c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * Copyright (C) 2008 The Android Open Source Project 3c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * All rights reserved. 4c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * 5c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * Redistribution and use in source and binary forms, with or without 6c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * modification, are permitted provided that the following conditions 7c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * are met: 8c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * * Redistributions of source code must retain the above copyright 9c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * notice, this list of conditions and the following disclaimer. 10c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * * Redistributions in binary form must reproduce the above copyright 11c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * notice, this list of conditions and the following disclaimer in 12c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * the documentation and/or other materials provided with the 13c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * distribution. 14c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * 15c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 18c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 19c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 20c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 22c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 23c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 25c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * SUCH DAMAGE. 27c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner */ 28c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#ifndef _SYS_EPOLL_H_ 29c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define _SYS_EPOLL_H_ 30c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 31c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#include <sys/cdefs.h> 32c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 33c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner__BEGIN_DECLS 34c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 35c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define EPOLLIN 0x00000001 36c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define EPOLLPRI 0x00000002 37c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define EPOLLOUT 0x00000004 38c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define EPOLLERR 0x00000008 39c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define EPOLLHUP 0x00000010 40c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define EPOLLRDNORM 0x00000040 41c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define EPOLLRDBAND 0x00000080 42c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define EPOLLWRNORM 0x00000100 43c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define EPOLLWRBAND 0x00000200 44c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define EPOLLMSG 0x00000400 45c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define EPOLLET 0x80000000 46c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 47c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define EPOLL_CTL_ADD 1 48c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define EPOLL_CTL_DEL 2 49c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define EPOLL_CTL_MOD 3 50c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 51c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnertypedef union epoll_data 52c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner{ 53c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner void *ptr; 54c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner int fd; 55c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner unsigned int u32; 56c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner unsigned long long u64; 57c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner} epoll_data_t; 58c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 59c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnerstruct epoll_event 60c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner{ 61c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner unsigned int events; 62c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner epoll_data_t data; 63c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner}; 64c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 65c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnerint epoll_create(int size); 66c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnerint epoll_ctl(int epfd, int op, int fd, struct epoll_event *event); 67c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnerint epoll_wait(int epfd, struct epoll_event *events, int max, int timeout); 68c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 69c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner__END_DECLS 70c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 71c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#endif /* _SYS_EPOLL_H_ */ 72c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 73