aboutsummaryrefslogtreecommitdiff
path: root/core/sys/linux/bits.odin
diff options
context:
space:
mode:
authorWison Ye <wisonye@gmail.com>2025-03-22 17:51:08 +1300
committerWison Ye <wisonye@gmail.com>2025-03-22 17:51:08 +1300
commit01e81fe59739e76cfeba1622efafb38f4aa431eb (patch)
tree9ccefb682fe09474dd73e1d8c731a667f61bb158 /core/sys/linux/bits.odin
parent631406eeccf9c2dbf9d2914809b72fb853a63002 (diff)
Fixed #4892: 'EPoll_Event.events' should be bit set.
Diffstat (limited to 'core/sys/linux/bits.odin')
-rw-r--r--core/sys/linux/bits.odin38
1 files changed, 22 insertions, 16 deletions
diff --git a/core/sys/linux/bits.odin b/core/sys/linux/bits.odin
index 4493ea767..53660dc8f 100644
--- a/core/sys/linux/bits.odin
+++ b/core/sys/linux/bits.odin
@@ -1,5 +1,10 @@
package linux
+import "base:intrinsics"
+
+@(private)
+log2 :: intrinsics.constant_log2
+
/*
Represents an error returned by most of syscalls
@@ -1839,22 +1844,23 @@ EPoll_Flags_Bits :: enum {
}
EPoll_Event_Kind :: enum u32 {
- IN = 0x001,
- PRI = 0x002,
- OUT = 0x004,
- RDNORM = 0x040,
- RDBAND = 0x080,
- WRNORM = 0x100,
- WRBAND = 0x200,
- MSG = 0x400,
- ERR = 0x008,
- HUP = 0x010,
- RDHUP = 0x2000,
- EXCLUSIVE = 1<<28,
- WAKEUP = 1<<29,
- ONESHOT = 1<<30,
- ET = 1<<31,
-}
+ IN = log2(0x001),
+ PRI = log2(0x002),
+ OUT = log2(0x004),
+ RDNORM = log2(0x040),
+ RDBAND = log2(0x080),
+ WRNORM = log2(0x100),
+ WRBAND = log2(0x200),
+ MSG = log2(0x400),
+ ERR = log2(0x008),
+ HUP = log2(0x010),
+ RDHUP = log2(0x2000),
+ EXCLUSIVE = log2(1<<28),
+ WAKEUP = log2(1<<29),
+ ONESHOT = log2(1<<30),
+ ET = log2(1<<31),
+}
+EPoll_Event_Set :: bit_set[EPoll_Event_Kind; u32]
EPoll_Ctl_Opcode :: enum i32 {
ADD = 1,