summaryrefslogtreecommitdiff
path: root/src/ppoll.h
blob: 7d09d44d9249606923f06c58abe9588d193bc037 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifdef ppoll
#undef ppoll
#endif

#define ppoll compat_ppoll

static inline int compat_ppoll(struct pollfd *fds, nfds_t nfds,
		const struct timespec *timeout, const sigset_t *sigmask)
{
	if (timeout == NULL)
		return poll(fds, nfds, -1);
	else if (timeout->tv_sec == 0)
		return poll(fds, nfds, 500);
	else
		return poll(fds, nfds, timeout->tv_sec * 1000);
}