Linux epoll allow passing of any negative timeout value to epoll_wait
to cause unbound blocking
This fixes (test5(-2)) failure of epoll-shim test suite: https://github.com/jiixyj/epoll-shim
Differential D22517
Linux epoll: Allow passing of any negative timeout value to epoll_wait Authored by wulf on Nov 23 2019, 12:19 PM. Tags None Referenced Files
Details
Linux epoll allow passing of any negative timeout value to epoll_wait This fixes (test5(-2)) failure of epoll-shim test suite: https://github.com/jiixyj/epoll-shim /* Sample testcase */
#include <sys/epoll.h>
#include <assert.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int
main(int argc, char *argv[])
{
struct epoll_event event, events[1];
int epfd, err;
epfd = epoll_create1(EPOLL_CLOEXEC);
assert(epfd);
event.events = EPOLLOUT;
err = epoll_ctl(epfd, EPOLL_CTL_ADD, STDOUT_FILENO, &event);
assert(err == 0);
if (epoll_wait(epfd, events, 1, -2) <= 0) {
perror("epoll_wait failed");
exit(EXIT_FAILURE);
}
printf("ok\n");
return (EXIT_SUCCESS);
}
Diff Detail
Event Timeline
| ||||||||||||||||||||||||||||||||||||||||