| ... | @@ -241,12 +241,8 @@ pub const setitimer = @compileError("TODO: setitimer"); | ... | @@ -241,12 +241,8 @@ pub const setitimer = @compileError("TODO: setitimer"); |
| 241 | // getpid | 241 | // getpid |
| 242 | // pid_t getpid(void); | 242 | // pid_t getpid(void); |
| 243 | // asmlinkage long sys_getpid(void); | 243 | // asmlinkage long sys_getpid(void); |
| 244 | pub fn getpid() errno.Error!pid_t { | 244 | pub 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 | } |
| 251 | | 247 | |
| 252 | // sendfile | 248 | // sendfile |
| ... | @@ -994,12 +990,8 @@ pub const quotactl = @compileError("TODO: quotactl"); | ... | @@ -994,12 +990,8 @@ pub const quotactl = @compileError("TODO: quotactl"); |
| 994 | // gettid | 990 | // gettid |
| 995 | // pid_t gettid(void); | 991 | // pid_t gettid(void); |
| 996 | // asmlinkage long sys_gettid(void); | 992 | // asmlinkage long sys_gettid(void); |
| 997 | pub fn gettid() errno.Error!pid_t { | 993 | pub 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 | } |
| 1004 | | 996 | |
| 1005 | // readahead | 997 | // readahead |