authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-04-20 16:45:48 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-04-20 16:45:48 -07:00
log6c00554bbc2c3b01482a036e2cedcaf7d859e2ca
tree1e477bc0c0bc3b2eb01f6731b116865fd25bb388
parentf7f103e22f9c75ec0711c48a7b431eedff541be0

add gettid


2 files changed, 8 insertions(+), 1 deletions(-)

mod.zig+7-1
...@@ -993,7 +993,13 @@ pub const quotactl = @compileError("TODO: quotactl");...@@ -993,7 +993,13 @@ pub const quotactl = @compileError("TODO: quotactl");
993// gettid993// gettid
994// pid_t gettid(void);994// pid_t gettid(void);
995// asmlinkage long sys_gettid(void);995// asmlinkage long sys_gettid(void);
996pub const gettid = @compileError("TODO: gettid");996pub fn gettid() errno.Error!pid_t {
997 const r = syscall0(.gettid);
998 return switch (_errno(r)) {
999 .ok => @intCast(r),
1000 _ => |c| errno.errorFromInt(@intFromEnum(c)),
1001 };
1002}
9971003
998// readahead1004// readahead
999// ssize_t readahead(int fd, off_t offset, size_t count);1005// ssize_t readahead(int fd, off_t offset, size_t count);
test.zig+1
...@@ -22,4 +22,5 @@ test {...@@ -22,4 +22,5 @@ test {
22 _ = &linux.munlockall;22 _ = &linux.munlockall;
23 _ = &linux.vhangup;23 _ = &linux.vhangup;
24 _ = &linux.sync;24 _ = &linux.sync;
25 _ = &linux.gettid;
25}26}