File: poll.c

package info (click to toggle)
klibc 2.0.4-9
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,512 kB
  • sloc: ansic: 48,305; asm: 2,578; perl: 797; makefile: 200; sh: 191
file content (21 lines) | stat: -rw-r--r-- 426 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <errno.h>
#include <sys/poll.h>
#include <sys/syscall.h>

#ifndef __NR_poll

int poll(struct pollfd *fds, nfds_t nfds, long timeout)
{
	struct timespec timeout_ts;
	struct timespec *timeout_ts_p = NULL;

	if (timeout >= 0) {
		timeout_ts.tv_sec = timeout / 1000;
		timeout_ts.tv_nsec = (timeout % 1000) * 1000000;
		timeout_ts_p = &timeout_ts;
	}

	return ppoll(fds, nfds, timeout_ts_p, 0);
}

#endif /* __NR_poll */