hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 8dc0d620d50128ddfb464835912aebab01ad09a0
parent eb3cf2adb9481baa6a304eda1412e9780e3f1935
Author: Alexey Yerin <yyp@disroot.org>
Date:   Tue, 11 May 2021 11:40:47 +0300

rt: add flag parameter to fch{own,mod}at syscalls

Diffstat:
Mos/+linux/dirfdfs.ha | 4++--
Mrt/+linux/syscalls.ha | 20++++++++++----------
2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/os/+linux/dirfdfs.ha b/os/+linux/dirfdfs.ha @@ -282,7 +282,7 @@ fn fs_mkdir(fs: *fs::fs, path: str) (void | fs::error) = { fn fs_chmod(fs: *fs::fs, path: str, mode: fs::mode) (void | fs::error) = { let fs = fs: *os_filesystem; - return match (rt::fchmodat(fs.dirfd, path, mode: uint)) { + return match (rt::fchmodat(fs.dirfd, path, mode: uint, 0)) { err: rt::errno => return errno_to_fs(err), void => void, }; @@ -290,7 +290,7 @@ fn fs_chmod(fs: *fs::fs, path: str, mode: fs::mode) (void | fs::error) = { fn fs_chown(fs: *fs::fs, path: str, uid: uint, gid: uint) (void | fs::error) = { let fs = fs: *os_filesystem; - return match (rt::fchownat(fs.dirfd, path, uid, gid)) { + return match (rt::fchownat(fs.dirfd, path, uid, gid, 0)) { err: rt::errno => return errno_to_fs(err), void => void, }; diff --git a/rt/+linux/syscalls.ha b/rt/+linux/syscalls.ha @@ -95,29 +95,29 @@ export fn mknodat( export fn chmod(path: path, mode: uint) (void | errno) = { let path = kpath(path)?; - wrap_return(syscall3(SYS_fchmodat, - AT_FDCWD: u64, path: uintptr: u64, mode: u64))?; + wrap_return(syscall4(SYS_fchmodat, + AT_FDCWD: u64, path: uintptr: u64, mode: u64, 0))?; return; }; -export fn fchmodat(dirfd: int, path: path, mode: uint) (void | errno) = { +export fn fchmodat(dirfd: int, path: path, mode: uint, flags: int) (void | errno) = { let path = kpath(path)?; - wrap_return(syscall3(SYS_fchmodat, - dirfd: u64, path: uintptr: u64, mode: u64))?; + wrap_return(syscall4(SYS_fchmodat, + dirfd: u64, path: uintptr: u64, mode: u64, flags: u64))?; return; }; export fn chown(path: path, uid: uint, gid: uint) (void | errno) = { let path = kpath(path)?; - wrap_return(syscall4(SYS_fchownat, - AT_FDCWD: u64, path: uintptr: u64, uid: u32, gid: u32))?; + wrap_return(syscall5(SYS_fchownat, + AT_FDCWD: u64, path: uintptr: u64, uid: u32, gid: u32, 0))?; return; }; -export fn fchownat(dirfd: int, path: path, uid: uint, gid: uint) (void | errno) = { +export fn fchownat(dirfd: int, path: path, uid: uint, gid: uint, flags: int) (void | errno) = { let path = kpath(path)?; - wrap_return(syscall4(SYS_fchownat, - dirfd: u64, path: uintptr: u64, uid: u32, gid: u32))?; + wrap_return(syscall5(SYS_fchownat, + dirfd: u64, path: uintptr: u64, uid: u32, gid: u32, flags: u64))?; return; };