GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / toolchains / hndtools-arm-linux-2.6.36-uclibc-4.5.3 / arm-brcm-linux-uclibcgnueabi / sysroot / usr / include / sys / epoll.h
bloba04bd704cd0da39b78d8e6f483ae15afc5eab67b
1 /* Copyright (C) 2002-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 02111-1307 USA. */
19 #ifndef _SYS_EPOLL_H
20 #define _SYS_EPOLL_H 1
22 #include <stdint.h>
23 #include <sys/types.h>
25 /* Get __sigset_t. */
26 #include <bits/sigset.h>
28 #ifndef __sigset_t_defined
29 # define __sigset_t_defined
30 typedef __sigset_t sigset_t;
31 #endif
34 /* Flags to be passed to epoll_create1. */
36 enum
38 #if defined __alpha__
39 EPOLL_CLOEXEC = 010000000,
40 # define EPOLL_CLOEXEC EPOLL_CLOEXEC
41 EPOLL_NONBLOCK = 04
42 # define EPOLL_NONBLOCK EPOLL_NONBLOCK
43 #else
44 # if defined __sparc__
45 EPOLL_CLOEXEC = 020000000,
46 # else
47 EPOLL_CLOEXEC = 02000000,
48 # endif
49 # define EPOLL_CLOEXEC EPOLL_CLOEXEC
50 # if defined __mips__
51 EPOLL_NONBLOCK = 0200
52 # elif defined __sparc__
53 EPOLL_NONBLOCK = 040000
54 # else
55 EPOLL_NONBLOCK = 04000
56 # endif
57 #define EPOLL_NONBLOCK EPOLL_NONBLOCK
58 #endif
62 enum EPOLL_EVENTS
64 EPOLLIN = 0x001,
65 #define EPOLLIN EPOLLIN
66 EPOLLPRI = 0x002,
67 #define EPOLLPRI EPOLLPRI
68 EPOLLOUT = 0x004,
69 #define EPOLLOUT EPOLLOUT
70 EPOLLRDNORM = 0x040,
71 #define EPOLLRDNORM EPOLLRDNORM
72 EPOLLRDBAND = 0x080,
73 #define EPOLLRDBAND EPOLLRDBAND
74 EPOLLWRNORM = 0x100,
75 #define EPOLLWRNORM EPOLLWRNORM
76 EPOLLWRBAND = 0x200,
77 #define EPOLLWRBAND EPOLLWRBAND
78 EPOLLMSG = 0x400,
79 #define EPOLLMSG EPOLLMSG
80 EPOLLERR = 0x008,
81 #define EPOLLERR EPOLLERR
82 EPOLLHUP = 0x010,
83 #define EPOLLHUP EPOLLHUP
84 EPOLLRDHUP = 0x2000,
85 #define EPOLLRDHUP EPOLLRDHUP
86 EPOLLONESHOT = (1 << 30),
87 #define EPOLLONESHOT EPOLLONESHOT
88 EPOLLET = (1 << 31)
89 #define EPOLLET EPOLLET
93 /* Valid opcodes ( "op" parameter ) to issue to epoll_ctl(). */
94 #define EPOLL_CTL_ADD 1 /* Add a file descriptor to the interface. */
95 #define EPOLL_CTL_DEL 2 /* Remove a file descriptor from the interface. */
96 #define EPOLL_CTL_MOD 3 /* Change file descriptor epoll_event structure. */
99 typedef union epoll_data
101 void *ptr;
102 int fd;
103 uint32_t u32;
104 uint64_t u64;
105 } epoll_data_t;
107 struct epoll_event
109 uint32_t events; /* Epoll events */
110 epoll_data_t data; /* User data variable */
112 #if defined __x86_64__
113 __attribute__((packed))
114 #endif
118 __BEGIN_DECLS
120 /* Creates an epoll instance. Returns an fd for the new instance.
121 The "size" parameter is a hint specifying the number of file
122 descriptors to be associated with the new instance. The fd
123 returned by epoll_create() should be closed with close(). */
124 extern int epoll_create (int __size) __THROW;
126 /* Same as epoll_create but with a FLAGS parameter. The unused SIZE
127 parameter has been dropped. */
128 extern int epoll_create1 (int __flags) __THROW;
131 /* Manipulate an epoll instance "epfd". Returns 0 in case of success,
132 -1 in case of error ( the "errno" variable will contain the
133 specific error code ) The "op" parameter is one of the EPOLL_CTL_*
134 constants defined above. The "fd" parameter is the target of the
135 operation. The "event" parameter describes which events the caller
136 is interested in and any associated user data. */
137 extern int epoll_ctl (int __epfd, int __op, int __fd,
138 struct epoll_event *__event) __THROW;
141 /* Wait for events on an epoll instance "epfd". Returns the number of
142 triggered events returned in "events" buffer. Or -1 in case of
143 error with the "errno" variable set to the specific error code. The
144 "events" parameter is a buffer that will contain triggered
145 events. The "maxevents" is the maximum number of events to be
146 returned ( usually size of "events" ). The "timeout" parameter
147 specifies the maximum wait time in milliseconds (-1 == infinite).
149 This function is a cancellation point and therefore not marked with
150 __THROW. */
151 extern int epoll_wait (int __epfd, struct epoll_event *__events,
152 int __maxevents, int __timeout);
155 /* Same as epoll_wait, but the thread's signal mask is temporarily
156 and atomically replaced with the one provided as parameter.
158 This function is a cancellation point and therefore not marked with
159 __THROW. */
160 extern int epoll_pwait (int __epfd, struct epoll_event *__events,
161 int __maxevents, int __timeout,
162 __const __sigset_t *__ss);
164 __END_DECLS
166 #endif /* sys/epoll.h */