authorgravatar for lukas@lalinsky.comLukas Lalinsky <lukas@lalinsky.com> 2025-11-07 14:11:43+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-11-07 22:23:46+01:00
log852a1f718a306aa0a540c527a0c23d50b9f0db08
tree7ef204bfd37c6f9437c9fc94323bd2de4da717e2
parent92f64899c110808a80c70d05e572bbd8e2448732

Fix kqueue definitions on NetBSD

EVFILT_USER and NOTE_TRIGGER were wrong. Added missing ones along the way.

1 files changed, 41 insertions(+), 2 deletions(-)

lib/std/c.zig+41-2
...@@ -9958,7 +9958,9 @@ pub const EVFILT = switch (native_os) {...@@ -9958,7 +9958,9 @@ pub const EVFILT = switch (native_os) {
9958 /// Filesystem events9958 /// Filesystem events
9959 pub const FS = 7;9959 pub const FS = 7;
9960 /// User events9960 /// User events
9961 pub const USER = 1;9961 pub const USER = 8;
9962 /// Empty filter
9963 pub const EMPTY = 9;
9962 },9964 },
9963 .freebsd => struct {9965 .freebsd => struct {
9964 pub const READ = -1;9966 pub const READ = -1;
...@@ -10108,8 +10110,19 @@ pub const NOTE = switch (native_os) {...@@ -10108,8 +10110,19 @@ pub const NOTE = switch (native_os) {
10108 pub const PCTRLMASK = 4026531840;10110 pub const PCTRLMASK = 4026531840;
10109 },10111 },
10110 .netbsd => struct {10112 .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;
10111 /// On input, TRIGGER causes the event to be triggered for output.10124 /// On input, TRIGGER causes the event to be triggered for output.
10112 pub const TRIGGER = 0x08000000;10125 pub const TRIGGER = 0x01000000;
10113 /// low water mark10126 /// low water mark
10114 pub const LOWAT = 0x00000001;10127 pub const LOWAT = 0x00000001;
10115 /// vnode was removed10128 /// vnode was removed
...@@ -10126,6 +10139,14 @@ pub const NOTE = switch (native_os) {...@@ -10126,6 +10139,14 @@ pub const NOTE = switch (native_os) {
10126 pub const RENAME = 0x00000020;10139 pub const RENAME = 0x00000020;
10127 /// vnode access was revoked10140 /// vnode access was revoked
10128 pub const REVOKE = 0x00000040;10141 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;
10129 /// process exited10150 /// process exited
10130 pub const EXIT = 0x80000000;10151 pub const EXIT = 0x80000000;
10131 /// process forked10152 /// process forked
...@@ -10135,6 +10156,24 @@ pub const NOTE = switch (native_os) {...@@ -10135,6 +10156,24 @@ pub const NOTE = switch (native_os) {
10135 /// mask for signal & exit status10156 /// mask for signal & exit status
10136 pub const PDATAMASK = 0x000fffff;10157 pub const PDATAMASK = 0x000fffff;
10137 pub const PCTRLMASK = 0xf0000000;10158 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;
10138 },10177 },
10139 .freebsd => struct {10178 .freebsd => struct {
10140 /// On input, TRIGGER causes the event to be triggered for output.10179 /// On input, TRIGGER causes the event to be triggered for output.