Portable implementation of the kqueue() and kevent() system calls