fchown: use the 32-bit uid/gid variant of the syscall on 32-bit linux targets

This commit is contained in:
Vesim 2021-12-27 16:10:17 +01:00 committed by Veikka Tuominen
parent 6d1b1374f7
commit 8c90b05add

View File

@ -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`.