sys_shm_open: fchmod the returned descriptor to get correct perms

this doesn't happen by default
This commit is contained in:
Beau McCartney
2024-03-16 12:13:00 -06:00
parent 24f9e16dfd
commit 1758bd683e

View File

@@ -206,5 +206,9 @@ sys_shm_open :: proc(name: string, oflag: Open_Flags, mode: Permission) -> (c.in
result := syscall_shm_open(cname, cmode, cflags)
state := result != -1
if state && cflags != 0 {
state = (syscall_fchmod(result, cflags) != -1)
}
return result * cast(c.int)state, state
}