kqueue

Kqueue is a scalable event notification interface introduced in FreeBSD 4.1 in July 2000,[1][2] also supported in NetBSD, OpenBSD, DragonFly BSD, and macOS.

Kqueue was originally authored in 2000 by Jonathan Lemon,[1][2] then involved with the FreeBSD Core Team.

[3][4] The term "kqueue" refers to its function as a "kernel event queue"[1][2] Kqueue provides efficient input and output event pipelines between the kernel and userland.

Kqueue not only handles file descriptor events but is also used for various other notifications such as file modification monitoring, signals, asynchronous I/O events (AIO), child process state change monitoring, and timers which support nanosecond resolution, furthermore kqueue provides a way to use user-defined events in addition to the ones provided by the kernel.

libkqueue is a user space implementation of kqueue(2), which translates calls to an operating system's native backend event mechanism.