iv_fd_poll: Don't bother with trying to call ppoll(2) by hand.

On Linux, ppoll(2) has existed since 2.6.16, and the glibc wrapper
for it has existed since glibc 2.4, which are both old enough to
not bother with trying to use syscall(2) to call it by hand.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
iv_fd_pump: Fix conditional inclusion of sys/syscall.h.

Since HAVE_SYS_SYSCALL_H is defined in config.h, we need to
include config.h before testing whether to include sys/syscall.h.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Automatically include iv_{fd,handle}_private.h from iv_private.h.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Rename iv_{fd,handle}_private.h to iv_private_{posix,win32}.h.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Move platform specific bits from iv_private.h to iv_private_{posix,win32}.h.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Turn iv_pending_tasks() into an inline function.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Introduce to_msec() to convert a timespec to a millisecond count.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Pass in a NULL timeout to poll methods if there are no registered timers.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
iv_event_bench: Add signal-driven timeout mode.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Add test/iv_event_bench_raw, an iv_event_raw benchmarking tool.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Convert bitfields in struct iv_fd_ to unsigned chars.

For a slight increase in code efficiency.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
iv_fd: Switch ->poll() timeouts from relative to absolute.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Add test/iv_signal_bench, an iv_signal benchmarking tool.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
iv_time_posix: Use CLOCK_MONOTONIC_FAST if available.

Since CLOCK_MONOTONIC is excruciatingly slow on FreeBSD, and while
CLOCK_MONOTONIC_FAST is faster but less precise, we don't need the
extra precision for iv_now as much as we need the extra speed.

Suggestion from Balazs Scheidler <bazsi@balabit.hu>.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
iv_fd_poll: Remove superfluous sys/poll.h include.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Remove various superfluous initializations to zero.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Include all files required for building in the tarball.

A couple of private, no-inst headers and the versioning linker scripts
are needed to build ivykis, so include them all in the tarball.

Reported-by: Peter Czanik <czanik@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>