?RCS: $Id: d_epoll.U 9719 2005-10-01 16:23:49Z cbiere $ ?RCS: ?RCS: @COPYRIGHT@ ?RCS: ?MAKE:d_epoll: Myread Setvar cat rm +cc +ccflags +ldflags ?MAKE: -pick add $@ %< ?S:d_epoll: ?S: This variable conditionally defines the HAS_EPOLL symbol, which ?S: indicates to the C program that epoll() support is available. ?S:. ?C:HAS_EPOLL: ?C: This symbol is defined when epoll() can be used. ?C:. ?H:#$d_epoll HAS_EPOLL ?H:. ?LINT: set d_epoll : can we use epoll? echo " " echo "Checking whether epoll() is available ..." >&4 val="$define" $cat >try.c <<'EOC' #include #include int main(void) { struct epoll_event ev[1]; int ret, epfd; epfd = epoll_create(1); ev[0].events = EPOLLIN | EPOLLOUT | EPOLLPRI | EPOLLERR | EPOLLHUP | EPOLLET; ev[0].data.ptr = (void *) 0; ev[0].data.fd = 1; ev[0].data.u32 = 1; ev[0].data.u64 = 1; ret = epoll_ctl(epfd, 1, EPOLL_CTL_ADD, &ev[0]); ret = epoll_ctl(epfd, 1, EPOLL_CTL_MOD, &ev[0]); ret = epoll_ctl(epfd, 1, EPOLL_CTL_DEL, &ev[0]); ret = epoll_wait(epfd, &ev[0], 1, -1); return 0; } EOC if $cc $ccflags $ldflags -o try try.c >/dev/null 2>&1; then echo 'It looks like epoll() is usable on your system, good.' else echo 'Sorry, I will not be using epoll().' val="$undef" fi $rm -f try try.c set d_epoll eval $setvar