From 01e81fe59739e76cfeba1622efafb38f4aa431eb Mon Sep 17 00:00:00 2001 From: Wison Ye Date: Sat, 22 Mar 2025 17:51:08 +1300 Subject: Fixed #4892: 'EPoll_Event.events' should be bit set. --- core/sys/linux/bits.odin | 38 ++++++++++++++++++++++---------------- core/sys/linux/types.odin | 2 +- 2 files changed, 23 insertions(+), 17 deletions(-) (limited to 'core/sys/linux') 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, diff --git a/core/sys/linux/types.odin b/core/sys/linux/types.odin index dcc72f72b..8f2284f56 100644 --- a/core/sys/linux/types.odin +++ b/core/sys/linux/types.odin @@ -1450,7 +1450,7 @@ EPoll_Data :: struct #raw_union { } EPoll_Event :: struct #packed { - events: EPoll_Event_Kind, + events: EPoll_Event_Set, data: EPoll_Data, } -- cgit v1.2.3 From c5980ba6c4ffaa570ea7bd629dc6e1886ec0456c Mon Sep 17 00:00:00 2001 From: Harold Brenes Date: Wed, 2 Apr 2025 16:39:25 -0400 Subject: Add linux build tag to core/sys/linux/sys.odin --- core/sys/linux/sys.odin | 1 + 1 file changed, 1 insertion(+) (limited to 'core/sys/linux') diff --git a/core/sys/linux/sys.odin b/core/sys/linux/sys.odin index 5fc4a0efa..985623e85 100644 --- a/core/sys/linux/sys.odin +++ b/core/sys/linux/sys.odin @@ -1,3 +1,4 @@ +#+build linux #+no-instrumentation package linux -- cgit v1.2.3 From 4998d4ebd0e123fa468e4e153351589f83d7cca8 Mon Sep 17 00:00:00 2001 From: jason Date: Sun, 13 Apr 2025 12:05:39 -0400 Subject: Fix linux.dirent_name Was not searching the first possible byte for 0. --- core/sys/linux/wrappers.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/sys/linux') diff --git a/core/sys/linux/wrappers.odin b/core/sys/linux/wrappers.odin index ab1992a57..7b0dc61e2 100644 --- a/core/sys/linux/wrappers.odin +++ b/core/sys/linux/wrappers.odin @@ -93,10 +93,10 @@ dirent_name :: proc "contextless" (dirent: ^Dirent) -> string #no_bounds_check { trunc := min(str_size, 8) str_size -= trunc for _ in 0.. Date: Mon, 12 May 2025 16:45:51 +0200 Subject: Update `linux.Map_Flags_Bits` Fixes #5151 - Removes `SHARED_VALIDATE` from the enum and turns it into `Map_Shared_Validate :: Map_Flags{.SHARED, .PRIVATE}` so it has the proper value of 0x03. - Adds `DROPPABLE`. - Adds constants `MAP_HUGE_SHIFT` and `MAP_HUGE_MASK`. - Adds the huge page precomputed constants from `mman.h`, defined as the log2 of the size shifted left by `MAP_HUGE_SHIFT`: Map_Huge_16KB Map_Huge_64KB Map_Huge_512KB Map_Huge_1MB Map_Huge_2MB Map_Huge_8MB Map_Huge_16MB Map_Huge_32MB Map_Huge_256MB Map_Huge_512MB Map_Huge_1GB Map_Huge_2GB Map_Huge_16GB --- core/sys/linux/bits.odin | 8 ++++++-- core/sys/linux/types.odin | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'core/sys/linux') diff --git a/core/sys/linux/bits.odin b/core/sys/linux/bits.odin index 53660dc8f..88f211427 100644 --- a/core/sys/linux/bits.odin +++ b/core/sys/linux/bits.odin @@ -579,7 +579,7 @@ Inotify_Event_Bits :: enum u32 { /* Bits for Mem_Protection bitfield */ -Mem_Protection_Bits :: enum{ +Mem_Protection_Bits :: enum { READ = 0, WRITE = 1, EXEC = 2, @@ -598,7 +598,7 @@ Mem_Protection_Bits :: enum{ Map_Flags_Bits :: enum { SHARED = 0, PRIVATE = 1, - SHARED_VALIDATE = 2, + DROPPABLE = 3, FIXED = 4, ANONYMOUS = 5, // platform-dependent section start @@ -619,6 +619,10 @@ Map_Flags_Bits :: enum { UNINITIALIZED = 26, } +// Not actually flags, but a shift and mask for when HUGETLB is defined +MAP_HUGE_SHIFT :: 26 +MAP_HUGE_MASK :: 63 + /* Bits for MLock_Flags */ diff --git a/core/sys/linux/types.odin b/core/sys/linux/types.odin index 8f2284f56..66af3395e 100644 --- a/core/sys/linux/types.odin +++ b/core/sys/linux/types.odin @@ -371,6 +371,21 @@ Mem_Protection :: bit_set[Mem_Protection_Bits; i32] */ Map_Flags :: bit_set[Map_Flags_Bits; i32] +Map_Shared_Validate :: Map_Flags{.SHARED, .PRIVATE} +Map_Huge_16KB :: transmute(Map_Flags)(u32(14) << MAP_HUGE_SHIFT) +Map_Huge_64KB :: transmute(Map_Flags)(u32(16) << MAP_HUGE_SHIFT) +Map_Huge_512KB :: transmute(Map_Flags)(u32(19) << MAP_HUGE_SHIFT) +Map_Huge_1MB :: transmute(Map_Flags)(u32(20) << MAP_HUGE_SHIFT) +Map_Huge_2MB :: transmute(Map_Flags)(u32(21) << MAP_HUGE_SHIFT) +Map_Huge_8MB :: transmute(Map_Flags)(u32(23) << MAP_HUGE_SHIFT) +Map_Huge_16MB :: transmute(Map_Flags)(u32(24) << MAP_HUGE_SHIFT) +Map_Huge_32MB :: transmute(Map_Flags)(u32(25) << MAP_HUGE_SHIFT) +Map_Huge_256MB :: transmute(Map_Flags)(u32(28) << MAP_HUGE_SHIFT) +Map_Huge_512MB :: transmute(Map_Flags)(u32(29) << MAP_HUGE_SHIFT) +Map_Huge_1GB :: transmute(Map_Flags)(u32(30) << MAP_HUGE_SHIFT) +Map_Huge_2GB :: transmute(Map_Flags)(u32(31) << MAP_HUGE_SHIFT) +Map_Huge_16GB :: transmute(Map_Flags)(u32(34) << MAP_HUGE_SHIFT) + /* Flags for mlock(2). */ -- cgit v1.2.3 From be24feb862808d729b8b89f24116319deefde632 Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Mon, 12 May 2025 17:13:59 +0200 Subject: Move things to constants.odin --- core/sys/linux/bits.odin | 6 ++---- core/sys/linux/constants.odin | 19 +++++++++++++++++++ core/sys/linux/types.odin | 17 ++--------------- 3 files changed, 23 insertions(+), 19 deletions(-) (limited to 'core/sys/linux') diff --git a/core/sys/linux/bits.odin b/core/sys/linux/bits.odin index 88f211427..d4edf354b 100644 --- a/core/sys/linux/bits.odin +++ b/core/sys/linux/bits.odin @@ -594,6 +594,8 @@ Mem_Protection_Bits :: enum { /* Bits for Map_Flags + + See `constants.odin` for `MAP_SHARED_VALIDATE` and `MAP_HUGE_16KB`, et al. */ Map_Flags_Bits :: enum { SHARED = 0, @@ -619,10 +621,6 @@ Map_Flags_Bits :: enum { UNINITIALIZED = 26, } -// Not actually flags, but a shift and mask for when HUGETLB is defined -MAP_HUGE_SHIFT :: 26 -MAP_HUGE_MASK :: 63 - /* Bits for MLock_Flags */ diff --git a/core/sys/linux/constants.odin b/core/sys/linux/constants.odin index b3bbcafb3..1010c931a 100644 --- a/core/sys/linux/constants.odin +++ b/core/sys/linux/constants.odin @@ -373,3 +373,22 @@ PTRACE_SECCOMP_GET_FILTER :: PTrace_Seccomp_Get_Filter_Type(.SECCOMP_GET_FIL PTRACE_SECCOMP_GET_METADATA :: PTrace_Seccomp_Get_Metadata_Type(.SECCOMP_GET_METADATA) PTRACE_GET_SYSCALL_INFO :: PTrace_Get_Syscall_Info_Type(.GET_SYSCALL_INFO) PTRACE_GET_RSEQ_CONFIGURATION :: PTrace_Get_RSeq_Configuration_Type(.GET_RSEQ_CONFIGURATION) + +MAP_SHARED_VALIDATE :: Map_Flags{.SHARED, .PRIVATE} + +MAP_HUGE_SHIFT :: 26 +MAP_HUGE_MASK :: 63 + +MAP_HUGE_16KB :: transmute(Map_Flags)(u32(14) << MAP_HUGE_SHIFT) +MAP_HUGE_64KB :: transmute(Map_Flags)(u32(16) << MAP_HUGE_SHIFT) +MAP_HUGE_512KB :: transmute(Map_Flags)(u32(19) << MAP_HUGE_SHIFT) +MAP_HUGE_1MB :: transmute(Map_Flags)(u32(20) << MAP_HUGE_SHIFT) +MAP_HUGE_2MB :: transmute(Map_Flags)(u32(21) << MAP_HUGE_SHIFT) +MAP_HUGE_8MB :: transmute(Map_Flags)(u32(23) << MAP_HUGE_SHIFT) +MAP_HUGE_16MB :: transmute(Map_Flags)(u32(24) << MAP_HUGE_SHIFT) +MAP_HUGE_32MB :: transmute(Map_Flags)(u32(25) << MAP_HUGE_SHIFT) +MAP_HUGE_256MB :: transmute(Map_Flags)(u32(28) << MAP_HUGE_SHIFT) +MAP_HUGE_512MB :: transmute(Map_Flags)(u32(29) << MAP_HUGE_SHIFT) +MAP_HUGE_1GB :: transmute(Map_Flags)(u32(30) << MAP_HUGE_SHIFT) +MAP_HUGE_2GB :: transmute(Map_Flags)(u32(31) << MAP_HUGE_SHIFT) +MAP_HUGE_16GB :: transmute(Map_Flags)(u32(34) << MAP_HUGE_SHIFT) \ No newline at end of file diff --git a/core/sys/linux/types.odin b/core/sys/linux/types.odin index 66af3395e..b5670cf87 100644 --- a/core/sys/linux/types.odin +++ b/core/sys/linux/types.odin @@ -368,24 +368,11 @@ Mem_Protection :: bit_set[Mem_Protection_Bits; i32] /* Flags for mmap. + + See `constants.odin` for `MAP_SHARED_VALIDATE` and `MAP_HUGE_16KB`, et al. */ Map_Flags :: bit_set[Map_Flags_Bits; i32] -Map_Shared_Validate :: Map_Flags{.SHARED, .PRIVATE} -Map_Huge_16KB :: transmute(Map_Flags)(u32(14) << MAP_HUGE_SHIFT) -Map_Huge_64KB :: transmute(Map_Flags)(u32(16) << MAP_HUGE_SHIFT) -Map_Huge_512KB :: transmute(Map_Flags)(u32(19) << MAP_HUGE_SHIFT) -Map_Huge_1MB :: transmute(Map_Flags)(u32(20) << MAP_HUGE_SHIFT) -Map_Huge_2MB :: transmute(Map_Flags)(u32(21) << MAP_HUGE_SHIFT) -Map_Huge_8MB :: transmute(Map_Flags)(u32(23) << MAP_HUGE_SHIFT) -Map_Huge_16MB :: transmute(Map_Flags)(u32(24) << MAP_HUGE_SHIFT) -Map_Huge_32MB :: transmute(Map_Flags)(u32(25) << MAP_HUGE_SHIFT) -Map_Huge_256MB :: transmute(Map_Flags)(u32(28) << MAP_HUGE_SHIFT) -Map_Huge_512MB :: transmute(Map_Flags)(u32(29) << MAP_HUGE_SHIFT) -Map_Huge_1GB :: transmute(Map_Flags)(u32(30) << MAP_HUGE_SHIFT) -Map_Huge_2GB :: transmute(Map_Flags)(u32(31) << MAP_HUGE_SHIFT) -Map_Huge_16GB :: transmute(Map_Flags)(u32(34) << MAP_HUGE_SHIFT) - /* Flags for mlock(2). */ -- cgit v1.2.3 From 306d3a16c4935dbb0f68735de01773800d1bad87 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Sat, 17 May 2025 19:40:57 +0200 Subject: sys/linux: Improve documentation for Dirent and related procedures --- core/sys/linux/types.odin | 2 +- core/sys/linux/wrappers.odin | 68 ++++++++++++++++++++++++++++++++------------ 2 files changed, 51 insertions(+), 19 deletions(-) (limited to 'core/sys/linux') diff --git a/core/sys/linux/types.odin b/core/sys/linux/types.odin index b5670cf87..08e0026d3 100644 --- a/core/sys/linux/types.odin +++ b/core/sys/linux/types.odin @@ -288,7 +288,7 @@ Rename_Flags :: bit_set[Rename_Flags_Bits; u32] /* Directory entry record. - Recommended iterate these with `dirent_iterator()`, + Recommended to iterate these with `dirent_iterate_buf()`, and obtain the name via `dirent_name()`. */ Dirent :: struct { diff --git a/core/sys/linux/wrappers.odin b/core/sys/linux/wrappers.odin index 7b0dc61e2..d93928364 100644 --- a/core/sys/linux/wrappers.odin +++ b/core/sys/linux/wrappers.odin @@ -54,22 +54,45 @@ WCOREDUMP :: #force_inline proc "contextless" (s: u32) -> bool { // TODO: sigaddset etc -/// Iterate the results of getdents -/// Only iterates as much data as loaded in the buffer -/// In case you need to iterate *all* files in a directory -/// consider using dirent_get_iterate -/// -/// Example of using dirent_iterate_buf -/// // Get dirents into a buffer -/// buf: [128]u8 -/// sys.getdents(dirfd, buf[:]) -/// // Print the names of the files -/// for dir in sys.dirent_iterate_buf(buf[:], &offs) { -/// name := sys.dirent_name(dir) -/// fmt.println(name) -/// } -/// This function doesn't automatically make a request -/// for the buffer to be refilled +/* +Iterate the results of `getdents()`. + +This procedure extracts a directory entry from `buf` at the offset `offs`. +`offs` will be modified to store an offset to the possible next directory entry +in `buf`. The procedure only iterates as much data as loaded in the buffer and +does not automatically make a request for the buffer to be refilled. + +**Inputs**: +- `buf` - byte buffer with data from `getdents()` +- `offs` - offset to the next possible directory entry in `buf` + +**Returns**: +- A pointer to a directory entry in `buf`, or `nil`. +- A bool value denoting if a valid directory entry is returned. + +**Example**: + + import "core:fmt" + import "core:sys/linux" + + print_names :: proc(dirfd: linux.Fd) { + // Get dirents into a buffer. + buf: [128]u8 + // Loop until there are no more entries. + for { + written, err := linux.getdents(dirfd, buf[:]) + if err != .NONE || written == 0 { + break + } + // Print the names of the files. + offset : int + for dir in linux.dirent_iterate_buf(buf[:written], &offset) { + name := linux.dirent_name(dir) + fmt.println(name) + } + } + } +*/ dirent_iterate_buf :: proc "contextless" (buf: []u8, offs: ^int) -> (d: ^Dirent, cont: bool) { // Stopped iterating when there's no space left if offs^ >= len(buf) { @@ -82,8 +105,17 @@ dirent_iterate_buf :: proc "contextless" (buf: []u8, offs: ^int) -> (d: ^Dirent, return dirent, true } -/// Obtain the name of dirent as a string -/// The lifetime of the string is bound to the lifetime of the provided dirent structure +/* +Obtain the name of dirent as a string. + +The lifetime of the returned string is bound to the lifetime of the provided dirent structure. + +**Inputs**: +- `dirent` - directory entry + +**Returns**: +- A name of the entry +*/ dirent_name :: proc "contextless" (dirent: ^Dirent) -> string #no_bounds_check { str := ([^]u8)(&dirent.name) // Dirents are aligned to 8 bytes, so there is guaranteed to be a null -- cgit v1.2.3 From 3519cecb7c59d0e803369464e555c0c38f9b1268 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Sun, 18 May 2025 15:25:17 +0200 Subject: Formatting fixes --- core/sys/linux/wrappers.odin | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'core/sys/linux') diff --git a/core/sys/linux/wrappers.odin b/core/sys/linux/wrappers.odin index d93928364..53eb80f86 100644 --- a/core/sys/linux/wrappers.odin +++ b/core/sys/linux/wrappers.odin @@ -62,15 +62,15 @@ This procedure extracts a directory entry from `buf` at the offset `offs`. in `buf`. The procedure only iterates as much data as loaded in the buffer and does not automatically make a request for the buffer to be refilled. -**Inputs**: -- `buf` - byte buffer with data from `getdents()` -- `offs` - offset to the next possible directory entry in `buf` +Inputs: +- buf: A byte buffer with data from `getdents()` +- offs: An offset to the next possible directory entry in `buf` -**Returns**: -- A pointer to a directory entry in `buf`, or `nil`. -- A bool value denoting if a valid directory entry is returned. +Returns: +- A pointer to a directory entry in `buf`, or `nil` +- A bool value denoting if a valid directory entry is returned -**Example**: +Example: import "core:fmt" import "core:sys/linux" @@ -110,10 +110,10 @@ Obtain the name of dirent as a string. The lifetime of the returned string is bound to the lifetime of the provided dirent structure. -**Inputs**: -- `dirent` - directory entry +Inputs: +- dirent: A directory entry -**Returns**: +Returns: - A name of the entry */ dirent_name :: proc "contextless" (dirent: ^Dirent) -> string #no_bounds_check { -- cgit v1.2.3 From 876f1c02b7ab0522179c5ef154a879973832af70 Mon Sep 17 00:00:00 2001 From: Tohei Ichikawa Date: Sun, 8 Jun 2025 12:47:50 -0400 Subject: Added missing parameter to `gettimeofday` --- core/sys/linux/sys.odin | 4 ++-- core/sys/linux/types.odin | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'core/sys/linux') diff --git a/core/sys/linux/sys.odin b/core/sys/linux/sys.odin index 985623e85..e9d0f4d76 100644 --- a/core/sys/linux/sys.odin +++ b/core/sys/linux/sys.odin @@ -1412,8 +1412,8 @@ umask :: proc "contextless" (mask: Mode) -> Mode { Get current time. Available since Linux 1.0. */ -gettimeofday :: proc "contextless" (tv: ^Time_Val) -> (Errno) { - ret := syscall(SYS_gettimeofday, tv) +gettimeofday :: proc "contextless" (tv: ^Time_Val, tz: ^Time_Zone) -> (Errno) { + ret := syscall(SYS_gettimeofday, tv, tz) return Errno(-ret) } diff --git a/core/sys/linux/types.odin b/core/sys/linux/types.odin index 08e0026d3..77a0b8ef4 100644 --- a/core/sys/linux/types.odin +++ b/core/sys/linux/types.odin @@ -72,6 +72,14 @@ Time_Val :: struct { microseconds: int, } +/* + Represents a time zone. +*/ +Time_Zone :: struct { + minutes_west: int, + dst_time: int, +} + /* Access and modification times for files */ -- cgit v1.2.3 From 7662e7d843f4248103ca818c43ff59e2683e30d5 Mon Sep 17 00:00:00 2001 From: Tohei Ichikawa Date: Sun, 8 Jun 2025 16:07:11 -0400 Subject: Removed obsolete `tz` param from `gettimeofday` --- core/sys/linux/sys.odin | 4 ++-- core/sys/linux/types.odin | 8 -------- 2 files changed, 2 insertions(+), 10 deletions(-) (limited to 'core/sys/linux') diff --git a/core/sys/linux/sys.odin b/core/sys/linux/sys.odin index e9d0f4d76..0e4cebce2 100644 --- a/core/sys/linux/sys.odin +++ b/core/sys/linux/sys.odin @@ -1412,8 +1412,8 @@ umask :: proc "contextless" (mask: Mode) -> Mode { Get current time. Available since Linux 1.0. */ -gettimeofday :: proc "contextless" (tv: ^Time_Val, tz: ^Time_Zone) -> (Errno) { - ret := syscall(SYS_gettimeofday, tv, tz) +gettimeofday :: proc "contextless" (tv: ^Time_Val) -> (Errno) { + ret := syscall(SYS_gettimeofday, tv, nil) return Errno(-ret) } diff --git a/core/sys/linux/types.odin b/core/sys/linux/types.odin index 77a0b8ef4..08e0026d3 100644 --- a/core/sys/linux/types.odin +++ b/core/sys/linux/types.odin @@ -72,14 +72,6 @@ Time_Val :: struct { microseconds: int, } -/* - Represents a time zone. -*/ -Time_Zone :: struct { - minutes_west: int, - dst_time: int, -} - /* Access and modification times for files */ -- cgit v1.2.3 From d2d187eaaa4fecd33bf654dcd9013ca2ddbdef5b Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Sun, 8 Jun 2025 22:53:52 +0200 Subject: Work around untyped nil --- core/sys/linux/sys.odin | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/sys/linux') diff --git a/core/sys/linux/sys.odin b/core/sys/linux/sys.odin index 0e4cebce2..f28a5fdb2 100644 --- a/core/sys/linux/sys.odin +++ b/core/sys/linux/sys.odin @@ -1413,7 +1413,8 @@ umask :: proc "contextless" (mask: Mode) -> Mode { Available since Linux 1.0. */ gettimeofday :: proc "contextless" (tv: ^Time_Val) -> (Errno) { - ret := syscall(SYS_gettimeofday, tv, nil) + null: uintptr + ret := syscall(SYS_gettimeofday, tv, null) return Errno(-ret) } -- cgit v1.2.3 From 0747032e4a836a4295538d2c4945f2610ad2e615 Mon Sep 17 00:00:00 2001 From: Feoramund <161657516+Feoramund@users.noreply.github.com> Date: Sun, 8 Jun 2025 17:46:48 -0400 Subject: Use idiomatic `rawptr(nil)` --- core/sys/linux/sys.odin | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'core/sys/linux') diff --git a/core/sys/linux/sys.odin b/core/sys/linux/sys.odin index f28a5fdb2..deb22726f 100644 --- a/core/sys/linux/sys.odin +++ b/core/sys/linux/sys.odin @@ -1413,8 +1413,7 @@ umask :: proc "contextless" (mask: Mode) -> Mode { Available since Linux 1.0. */ gettimeofday :: proc "contextless" (tv: ^Time_Val) -> (Errno) { - null: uintptr - ret := syscall(SYS_gettimeofday, tv, null) + ret := syscall(SYS_gettimeofday, tv, rawptr(nil)) return Errno(-ret) } -- cgit v1.2.3