… | |
… | |
388 | { |
388 | { |
389 | syserr_cb = cb; |
389 | syserr_cb = cb; |
390 | } |
390 | } |
391 | |
391 | |
392 | static void noinline |
392 | static void noinline |
393 | syserr (const char *msg) |
393 | ev_syserr (const char *msg) |
394 | { |
394 | { |
395 | if (!msg) |
395 | if (!msg) |
396 | msg = "(libev) system error"; |
396 | msg = "(libev) system error"; |
397 | |
397 | |
398 | if (syserr_cb) |
398 | if (syserr_cb) |
… | |
… | |
450 | { |
450 | { |
451 | WL head; |
451 | WL head; |
452 | unsigned char events; |
452 | unsigned char events; |
453 | unsigned char reify; |
453 | unsigned char reify; |
454 | unsigned char emask; /* the epoll backend stores the actual kernel mask in here */ |
454 | unsigned char emask; /* the epoll backend stores the actual kernel mask in here */ |
455 | unsigned char unused; /* currently unused padding */ |
455 | unsigned char unused; |
|
|
456 | #if EV_USE_EPOLL |
|
|
457 | unsigned int egen; /* generation counter to counter epoll bugs */ |
|
|
458 | #endif |
456 | #if EV_SELECT_IS_WINSOCKET |
459 | #if EV_SELECT_IS_WINSOCKET |
457 | SOCKET handle; |
460 | SOCKET handle; |
458 | #endif |
461 | #endif |
459 | } ANFD; |
462 | } ANFD; |
460 | |
463 | |
… | |
… | |
806 | |
809 | |
807 | for (fd = 0; fd < anfdmax; ++fd) |
810 | for (fd = 0; fd < anfdmax; ++fd) |
808 | if (anfds [fd].events) |
811 | if (anfds [fd].events) |
809 | { |
812 | { |
810 | anfds [fd].events = 0; |
813 | anfds [fd].events = 0; |
|
|
814 | anfds [fd].emask = 0; |
811 | fd_change (EV_A_ fd, EV_IOFDSET | 1); |
815 | fd_change (EV_A_ fd, EV_IOFDSET | 1); |
812 | } |
816 | } |
813 | } |
817 | } |
814 | |
818 | |
815 | /*****************************************************************************/ |
819 | /*****************************************************************************/ |
… | |
… | |
997 | } |
1001 | } |
998 | else |
1002 | else |
999 | #endif |
1003 | #endif |
1000 | { |
1004 | { |
1001 | while (pipe (evpipe)) |
1005 | while (pipe (evpipe)) |
1002 | syserr ("(libev) error creating signal/async pipe"); |
1006 | ev_syserr ("(libev) error creating signal/async pipe"); |
1003 | |
1007 | |
1004 | fd_intern (evpipe [0]); |
1008 | fd_intern (evpipe [0]); |
1005 | fd_intern (evpipe [1]); |
1009 | fd_intern (evpipe [1]); |
1006 | ev_io_set (&pipeev, evpipe [0], EV_READ); |
1010 | ev_io_set (&pipeev, evpipe [0], EV_READ); |
1007 | } |
1011 | } |
… | |
… | |
1655 | { |
1659 | { |
1656 | #if EV_MULTIPLICITY |
1660 | #if EV_MULTIPLICITY |
1657 | struct ev_loop *loop = ev_default_loop_ptr; |
1661 | struct ev_loop *loop = ev_default_loop_ptr; |
1658 | #endif |
1662 | #endif |
1659 | |
1663 | |
1660 | if (backend) |
|
|
1661 | postfork = 1; /* must be in line with ev_loop_fork */ |
1664 | postfork = 1; /* must be in line with ev_loop_fork */ |
1662 | } |
1665 | } |
1663 | |
1666 | |
1664 | /*****************************************************************************/ |
1667 | /*****************************************************************************/ |
1665 | |
1668 | |
1666 | void |
1669 | void |
… | |
… | |
2429 | if (w->wd < 0) |
2432 | if (w->wd < 0) |
2430 | { |
2433 | { |
2431 | ev_timer_start (EV_A_ &w->timer); /* this is not race-free, so we still need to recheck periodically */ |
2434 | ev_timer_start (EV_A_ &w->timer); /* this is not race-free, so we still need to recheck periodically */ |
2432 | |
2435 | |
2433 | /* monitor some parent directory for speedup hints */ |
2436 | /* monitor some parent directory for speedup hints */ |
2434 | /* note that exceeding the hardcoded limit is not a correctness issue, */ |
2437 | /* note that exceeding the hardcoded path limit is not a correctness issue, */ |
2435 | /* but an efficiency issue only */ |
2438 | /* but an efficiency issue only */ |
2436 | if ((errno == ENOENT || errno == EACCES) && strlen (w->path) < 4096) |
2439 | if ((errno == ENOENT || errno == EACCES) && strlen (w->path) < 4096) |
2437 | { |
2440 | { |
2438 | char path [4096]; |
2441 | char path [4096]; |
2439 | strcpy (path, w->path); |
2442 | strcpy (path, w->path); |