| ... | ... | @@ -796,13 +796,7 @@ pub fn chmod(path: [*:0]const u8, mode: mode_t) usize { |
| 796 | 796 | if (@hasField(SYS, "chmod")) { |
| 797 | 797 | return syscall2(.chmod, @intFromPtr(path), mode); |
| 798 | 798 | } else { |
| 799 | | return syscall4( |
| 800 | | .fchmodat, |
| 801 | | @as(usize, @bitCast(@as(isize, AT.FDCWD))), |
| 802 | | @intFromPtr(path), |
| 803 | | mode, |
| 804 | | 0, |
| 805 | | ); |
| 799 | return fchmodat(AT.FDCWD, path, mode, 0); |
| 806 | 800 | } |
| 807 | 801 | } |
| 808 | 802 | |
| ... | ... | @@ -814,8 +808,12 @@ pub fn fchown(fd: i32, owner: uid_t, group: gid_t) usize { |
| 814 | 808 | } |
| 815 | 809 | } |
| 816 | 810 | |
| 817 | | pub fn fchmodat(fd: i32, path: [*:0]const u8, mode: mode_t, flags: u32) usize { |
| 818 | | return syscall4(.fchmodat, @as(usize, @bitCast(@as(isize, fd))), @intFromPtr(path), mode, flags); |
| 811 | pub fn fchmodat(fd: i32, path: [*:0]const u8, mode: mode_t, _: u32) usize { |
| 812 | return syscall3(.fchmodat, @bitCast(@as(isize, fd)), @intFromPtr(path), mode); |
| 813 | } |
| 814 | |
| 815 | pub fn fchmodat2(fd: i32, path: [*:0]const u8, mode: mode_t, flags: u32) usize { |
| 816 | return syscall4(.fchmodat2, @bitCast(@as(isize, fd)), @intFromPtr(path), mode, flags); |
| 819 | 817 | } |
| 820 | 818 | |
| 821 | 819 | /// Can only be called on 32 bit systems. For 64 bit see `lseek`. |