ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev_epoll.c
(Generate patch)

Comparing libev/ev_epoll.c (file contents):
Revision 1.66 by root, Sun Dec 18 17:47:23 2011 UTC vs.
Revision 1.69 by root, Sun Oct 11 13:38:44 2015 UTC

177 * we assume that fd is always in range, as we never shrink the anfds array 177 * we assume that fd is always in range, as we never shrink the anfds array
178 */ 178 */
179 if (expect_false ((uint32_t)anfds [fd].egen != (uint32_t)(ev->data.u64 >> 32))) 179 if (expect_false ((uint32_t)anfds [fd].egen != (uint32_t)(ev->data.u64 >> 32)))
180 { 180 {
181 /* recreate kernel state */ 181 /* recreate kernel state */
182 postfork = 1; 182 postfork |= 2;
183 continue; 183 continue;
184 } 184 }
185 185
186 if (expect_false (got & ~want)) 186 if (expect_false (got & ~want))
187 { 187 {
226 unsigned char events = anfds [fd].events & (EV_READ | EV_WRITE); 226 unsigned char events = anfds [fd].events & (EV_READ | EV_WRITE);
227 227
228 if (anfds [fd].emask & EV_EMASK_EPERM && events) 228 if (anfds [fd].emask & EV_EMASK_EPERM && events)
229 fd_event (EV_A_ fd, events); 229 fd_event (EV_A_ fd, events);
230 else 230 else
231 {
231 epoll_eperms [i] = epoll_eperms [--epoll_epermcnt]; 232 epoll_eperms [i] = epoll_eperms [--epoll_epermcnt];
233 anfds [fd].emask = 0;
234 }
232 } 235 }
233} 236}
234 237
235int inline_size 238int inline_size
236epoll_init (EV_P_ int flags) 239epoll_init (EV_P_ int flags)
237{ 240{
238#ifdef EPOLL_CLOEXEC 241#ifdef EPOLL_CLOEXEC
239 backend_fd = epoll_create1 (EPOLL_CLOEXEC); 242 backend_fd = epoll_create1 (EPOLL_CLOEXEC);
240 243
241 if (backend_fd < 0) 244 if (backend_fd < 0 && (errno == EINVAL || errno == ENOSYS))
242#endif 245#endif
243 backend_fd = epoll_create (256); 246 backend_fd = epoll_create (256);
244 247
245 if (backend_fd < 0) 248 if (backend_fd < 0)
246 return 0; 249 return 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines