hare

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

commit 97e431ac01afd42dfa052a05c4687f8c553aaf1c
parent e006165a84869bbda990986d8169cb5592de6fc0
Author: Hugo Osvaldo Barrera <hugo@whynothugo.nl>
Date:   Wed, 26 Jun 2024 12:20:09 +0200

syscalls: add getxattr

Diffstat:
Mrt/+linux/syscalls.ha | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/rt/+linux/syscalls.ha b/rt/+linux/syscalls.ha @@ -1062,3 +1062,17 @@ export fn setxattr( flags: u64 ))?; }; + +// Gets an extended file attribute. +export fn getxattr(path: path, name: str, value: []u8) (u64 | errno) = { + let path = kpath(path)?; + static let namebuf: [PATH_MAX]u8 = [0...]; + let name = copy_kpath(name, namebuf)?; + + return wrap_return(syscall4(SYS_getxattr, + path: uintptr, + name: uintptr, + value: *[*]u8: uintptr: u64, + len(value): u64, + )); +};