Skip to content

Commit 852a1f7

Browse files
lalinskyalexrp
authored andcommitted
Fix kqueue definitions on NetBSD
EVFILT_USER and NOTE_TRIGGER were wrong. Added missing ones along the way.
1 parent 92f6489 commit 852a1f7

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

lib/std/c.zig

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9958,7 +9958,9 @@ pub const EVFILT = switch (native_os) {
99589958
/// Filesystem events
99599959
pub const FS = 7;
99609960
/// User events
9961-
pub const USER = 1;
9961+
pub const USER = 8;
9962+
/// Empty filter
9963+
pub const EMPTY = 9;
99629964
},
99639965
.freebsd => struct {
99649966
pub const READ = -1;
@@ -10108,8 +10110,19 @@ pub const NOTE = switch (native_os) {
1010810110
pub const PCTRLMASK = 4026531840;
1010910111
},
1011010112
.netbsd => struct {
10113+
/// ignore input fflags
10114+
pub const FFNOP = 0x00000000;
10115+
/// AND fflags
10116+
pub const FFAND = 0x40000000;
10117+
/// OR fflags
10118+
pub const FFOR = 0x80000000;
10119+
/// copy fflags
10120+
pub const FFCOPY = 0xc0000000;
10121+
/// masks for operations
10122+
pub const FFCTRLMASK = 0xc0000000;
10123+
pub const FFLAGSMASK = 0x00ffffff;
1011110124
/// On input, TRIGGER causes the event to be triggered for output.
10112-
pub const TRIGGER = 0x08000000;
10125+
pub const TRIGGER = 0x01000000;
1011310126
/// low water mark
1011410127
pub const LOWAT = 0x00000001;
1011510128
/// vnode was removed
@@ -10126,6 +10139,14 @@ pub const NOTE = switch (native_os) {
1012610139
pub const RENAME = 0x00000020;
1012710140
/// vnode access was revoked
1012810141
pub const REVOKE = 0x00000040;
10142+
/// vnode was opened
10143+
pub const OPEN = 0x00000080;
10144+
/// file closed (no FWRITE)
10145+
pub const CLOSE = 0x00000100;
10146+
/// file closed (FWRITE)
10147+
pub const CLOSE_WRITE = 0x00000200;
10148+
/// file was read
10149+
pub const READ = 0x00000400;
1012910150
/// process exited
1013010151
pub const EXIT = 0x80000000;
1013110152
/// process forked
@@ -10135,6 +10156,24 @@ pub const NOTE = switch (native_os) {
1013510156
/// mask for signal & exit status
1013610157
pub const PDATAMASK = 0x000fffff;
1013710158
pub const PCTRLMASK = 0xf0000000;
10159+
/// follow across forks
10160+
pub const TRACK = 0x00000001;
10161+
/// could not track child
10162+
pub const TRACKERR = 0x00000002;
10163+
/// am a child process
10164+
pub const CHILD = 0x00000004;
10165+
/// shared with EVFILT_SIGNAL
10166+
pub const SIGNAL = 0x08000000;
10167+
/// data is milliseconds
10168+
pub const MSECONDS = 0x00000000;
10169+
/// data is seconds
10170+
pub const SECONDS = 0x00000001;
10171+
/// data is microseconds
10172+
pub const USECONDS = 0x00000002;
10173+
/// data is nanoseconds
10174+
pub const NSECONDS = 0x00000003;
10175+
/// timeout is absolute
10176+
pub const ABSTIME = 0x00000010;
1013810177
},
1013910178
.freebsd => struct {
1014010179
/// On input, TRIGGER causes the event to be triggered for output.

0 commit comments

Comments
 (0)