mirror of
https://github.com/ziglang/zig.git
synced 2026-01-21 14:55:25 +00:00
fchown: use the 32-bit uid/gid variant of the syscall on 32-bit linux targets
This commit is contained in:
parent
6d1b1374f7
commit
8c90b05add
@ -738,7 +738,11 @@ pub fn fchmod(fd: i32, mode: mode_t) usize {
|
||||
}
|
||||
|
||||
pub fn fchown(fd: i32, owner: uid_t, group: gid_t) usize {
|
||||
return syscall3(.fchown, @bitCast(usize, @as(isize, fd)), owner, group);
|
||||
if (@hasField(SYS, "fchown32")) {
|
||||
return syscall3(.fchown32, @bitCast(usize, @as(isize, fd)), owner, group);
|
||||
} else {
|
||||
return syscall3(.fchown, @bitCast(usize, @as(isize, fd)), owner, group);
|
||||
}
|
||||
}
|
||||
|
||||
/// Can only be called on 32 bit systems. For 64 bit see `lseek`.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user