Source
pub const EV = switch (native_os) {
.macos, .ios, .tvos, .watchos, .visionos => struct {
/// add event to kq (implies enable)
pub const ADD = 0x0001;
/// delete event from kq
pub const DELETE = 0x0002;
/// enable event
pub const ENABLE = 0x0004;
/// disable event (not reported)
pub const DISABLE = 0x0008;
/// only report one occurrence
pub const ONESHOT = 0x0010;
/// clear event state after reporting
pub const CLEAR = 0x0020;
/// force immediate event output
/// ... with or without ERROR
/// ... use KEVENT_FLAG_ERROR_EVENTS
/// on syscalls supporting flags
pub const RECEIPT = 0x0040;
/// disable event after reporting
pub const DISPATCH = 0x0080;
/// unique kevent per udata value
pub const UDATA_SPECIFIC = 0x0100;
/// ... in combination with DELETE
/// will defer delete until udata-specific
/// event enabled. EINPROGRESS will be
/// returned to indicate the deferral
pub const DISPATCH2 = DISPATCH | UDATA_SPECIFIC;
/// report that source has vanished
/// ... only valid with DISPATCH2
pub const VANISHED = 0x0200;
/// reserved by system
pub const SYSFLAGS = 0xF000;
/// filter-specific flag
pub const FLAG0 = 0x1000;
/// filter-specific flag
pub const FLAG1 = 0x2000;
/// EOF detected
pub const EOF = 0x8000;
/// error, data contains errno
pub const ERROR = 0x4000;
pub const POLL = FLAG0;
pub const OOBAND = FLAG1;
},
.dragonfly => struct {
pub const ADD = 1;
pub const DELETE = 2;
pub const ENABLE = 4;
pub const DISABLE = 8;
pub const ONESHOT = 16;
pub const CLEAR = 32;
pub const RECEIPT = 64;
pub const DISPATCH = 128;
pub const NODATA = 4096;
pub const FLAG1 = 8192;
pub const ERROR = 16384;
pub const EOF = 32768;
pub const SYSFLAGS = 61440;
},
.netbsd => struct {
/// add event to kq (implies enable)
pub const ADD = 0x0001;
/// delete event from kq
pub const DELETE = 0x0002;
/// enable event
pub const ENABLE = 0x0004;
/// disable event (not reported)
pub const DISABLE = 0x0008;
/// only report one occurrence
pub const ONESHOT = 0x0010;
/// clear event state after reporting
pub const CLEAR = 0x0020;
/// force immediate event output
/// ... with or without ERROR
/// ... use KEVENT_FLAG_ERROR_EVENTS
/// on syscalls supporting flags
pub const RECEIPT = 0x0040;
/// disable event after reporting
pub const DISPATCH = 0x0080;
},
.freebsd => struct {
/// add event to kq (implies enable)
pub const ADD = 0x0001;
/// delete event from kq
pub const DELETE = 0x0002;
/// enable event
pub const ENABLE = 0x0004;
/// disable event (not reported)
pub const DISABLE = 0x0008;
/// only report one occurrence
pub const ONESHOT = 0x0010;
/// clear event state after reporting
pub const CLEAR = 0x0020;
/// error, event data contains errno
pub const ERROR = 0x4000;
/// force immediate event output
/// ... with or without ERROR
/// ... use KEVENT_FLAG_ERROR_EVENTS
/// on syscalls supporting flags
pub const RECEIPT = 0x0040;
/// disable event after reporting
pub const DISPATCH = 0x0080;
},
.openbsd => struct {
pub const ADD = 0x0001;
pub const DELETE = 0x0002;
pub const ENABLE = 0x0004;
pub const DISABLE = 0x0008;
pub const ONESHOT = 0x0010;
pub const CLEAR = 0x0020;
pub const RECEIPT = 0x0040;
pub const DISPATCH = 0x0080;
pub const FLAG1 = 0x2000;
pub const ERROR = 0x4000;
pub const EOF = 0x8000;
},
.haiku => struct {
/// add event to kq (implies enable)
pub const ADD = 0x0001;
/// delete event from kq
pub const DELETE = 0x0002;
/// enable event
pub const ENABLE = 0x0004;
/// disable event (not reported)
pub const DISABLE = 0x0008;
/// only report one occurrence
pub const ONESHOT = 0x0010;
/// clear event state after reporting
pub const CLEAR = 0x0020;
/// force immediate event output
/// ... with or without ERROR
/// ... use KEVENT_FLAG_ERROR_EVENTS
/// on syscalls supporting flags
pub const RECEIPT = 0x0040;
/// disable event after reporting
pub const DISPATCH = 0x0080;
},
else => void,
}