authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-08-24 02:42:13 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-08-24 02:42:13 -07:00
log264054e3fa57b2eb8e18078bf5cd88e5a96984af
tree11a1210b748ff5ff2a9a8963c23699fb6d90d14e
parent27014a22ec2b852a8b17387877dc531ed2fe098b

these don't set errno


1 files changed, 4 insertions(+), 12 deletions(-)

mod.zig+4-12
...@@ -241,12 +241,8 @@ pub const setitimer = @compileError("TODO: setitimer");...@@ -241,12 +241,8 @@ pub const setitimer = @compileError("TODO: setitimer");
241// getpid241// getpid
242// pid_t getpid(void);242// pid_t getpid(void);
243// asmlinkage long sys_getpid(void);243// asmlinkage long sys_getpid(void);
244pub fn getpid() errno.Error!pid_t {244pub fn getpid() pid_t {
245 const r = syscall0(.getpid);245 return @intCast(syscall0(.getpid));
246 return switch (_errno(r)) {
247 .ok => @intCast(r),
248 _ => |c| errno.errorFromInt(@intFromEnum(c)),
249 };
250}246}
251247
252// sendfile248// sendfile
...@@ -994,12 +990,8 @@ pub const quotactl = @compileError("TODO: quotactl");...@@ -994,12 +990,8 @@ pub const quotactl = @compileError("TODO: quotactl");
994// gettid990// gettid
995// pid_t gettid(void);991// pid_t gettid(void);
996// asmlinkage long sys_gettid(void);992// asmlinkage long sys_gettid(void);
997pub fn gettid() errno.Error!pid_t {993pub fn gettid() pid_t {
998 const r = syscall0(.gettid);994 return @intCast(syscall0(.gettid));
999 return switch (_errno(r)) {
1000 .ok => @intCast(r),
1001 _ => |c| errno.errorFromInt(@intFromEnum(c)),
1002 };
1003}995}
1004996
1005// readahead997// readahead