1 | /* |
1 | /* |
|
|
2 | * libev epoll fd activity backend |
|
|
3 | * |
2 | * Copyright (c) 2007 Marc Alexander Lehmann <libev@schmorp.de> |
4 | * Copyright (c) 2007 Marc Alexander Lehmann <libev@schmorp.de> |
3 | * All rights reserved. |
5 | * All rights reserved. |
4 | * |
6 | * |
5 | * Redistribution and use in source and binary forms, with or without |
7 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are |
8 | * modification, are permitted provided that the following conditions are |
… | |
… | |
53 | epoll_fd = epoll_create (256); |
55 | epoll_fd = epoll_create (256); |
54 | fcntl (epoll_fd, F_SETFD, FD_CLOEXEC); |
56 | fcntl (epoll_fd, F_SETFD, FD_CLOEXEC); |
55 | |
57 | |
56 | /* re-register interest in fds */ |
58 | /* re-register interest in fds */ |
57 | for (fd = 0; fd < anfdmax; ++fd) |
59 | for (fd = 0; fd < anfdmax; ++fd) |
58 | if (anfds [fd].events && !(anfds [fd].events & EV_REIFY))//D |
60 | if (anfds [fd].events)//D |
59 | epoll_modify (fd, EV_NONE, anfds [fd].events); |
61 | epoll_modify (fd, EV_NONE, anfds [fd].events); |
60 | } |
62 | } |
61 | |
63 | |
62 | static struct epoll_event *events; |
64 | static struct epoll_event *events; |
63 | static int eventmax; |
65 | static int eventmax; |