11dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*
21dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Copyright (C) 2008 The Android Open Source Project
31dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * All rights reserved.
41dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *
51dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Redistribution and use in source and binary forms, with or without
61dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * modification, are permitted provided that the following conditions
71dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * are met:
81dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *  * Redistributions of source code must retain the above copyright
91dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *    notice, this list of conditions and the following disclaimer.
101dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *  * Redistributions in binary form must reproduce the above copyright
111dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *    notice, this list of conditions and the following disclaimer in
121dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *    the documentation and/or other materials provided with the
131dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *    distribution.
141dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *
151dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
161dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
171dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
181dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
191dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
201dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
211dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
221dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
231dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
241dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
251dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
261dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * SUCH DAMAGE.
271dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project */
281dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifndef _SYS_EPOLL_H_
291dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define _SYS_EPOLL_H_
301dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
3149f0a8f23bba188466c6ee3652858ef4da228c6fDavid 'Digit' Turner#include <sys/cdefs.h>
3249f0a8f23bba188466c6ee3652858ef4da228c6fDavid 'Digit' Turner
3349f0a8f23bba188466c6ee3652858ef4da228c6fDavid 'Digit' Turner__BEGIN_DECLS
3449f0a8f23bba188466c6ee3652858ef4da228c6fDavid 'Digit' Turner
351dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define EPOLLIN          0x00000001
361dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define EPOLLPRI         0x00000002
371dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define EPOLLOUT         0x00000004
381dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define EPOLLERR         0x00000008
391dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define EPOLLHUP         0x00000010
401dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define EPOLLRDNORM      0x00000040
411dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define EPOLLRDBAND      0x00000080
421dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define EPOLLWRNORM      0x00000100
431dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define EPOLLWRBAND      0x00000200
441dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define EPOLLMSG         0x00000400
45d1ad4f6dab06189d4d3dcfa19ae4bc301481eb3fTodd Poynor#define EPOLLRDHUP       0x00002000
46d1ad4f6dab06189d4d3dcfa19ae4bc301481eb3fTodd Poynor#define EPOLLWAKEUP      0x20000000
47d1ad4f6dab06189d4d3dcfa19ae4bc301481eb3fTodd Poynor#define EPOLLONESHOT     0x40000000
481dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define EPOLLET          0x80000000
491dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
501dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define EPOLL_CTL_ADD    1
511dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define EPOLL_CTL_DEL    2
521dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define EPOLL_CTL_MOD    3
531dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
541dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projecttypedef union epoll_data
551dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project{
561dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    void *ptr;
571dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    int fd;
581dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned int u32;
591dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned long long u64;
601dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project} epoll_data_t;
611dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
621dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectstruct epoll_event
631dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project{
641dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned int events;
651dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    epoll_data_t data;
661dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project};
671dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
681dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint epoll_create(int size);
691dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint epoll_ctl(int epfd, int op, int fd, struct epoll_event *event);
701dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint epoll_wait(int epfd, struct epoll_event *events, int max, int timeout);
711dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
7249f0a8f23bba188466c6ee3652858ef4da228c6fDavid 'Digit' Turner__END_DECLS
7349f0a8f23bba188466c6ee3652858ef4da228c6fDavid 'Digit' Turner
741dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif  /* _SYS_EPOLL_H_ */
751dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
76