I think the kqueue API is worse than the epoll API. They make it try to do too much by dealing directly with all kind of events. epoll on the other hand simply deals with file descriptors and there are other APIs to get file descriptors for events (timerfd, signalfd, eventfd, inotify, etc.). That makes epoll a lot more flexible. It's more of a "do one thing and do it right" approach and it adopts the "everything is a file" mantra to "everything is a file descriptor".
One way where the problem with this is showing, is the filesystem notification API of kqueue. It is a ridiculously bad API. E.g., you can't properly watch a directory with it. Replacing it with something saner would require changes to kqueue. If it had been designed like epoll then it would only require adding a different API to create a filesystem notification file descriptor.
One way where the problem with this is showing, is the filesystem notification API of kqueue. It is a ridiculously bad API. E.g., you can't properly watch a directory with it. Replacing it with something saner would require changes to kqueue. If it had been designed like epoll then it would only require adding a different API to create a filesystem notification file descriptor.