| ... | ... | @@ -637,7 +637,13 @@ pub const setpgid = @compileError("TODO: setpgid"); |
| 637 | 637 | // getppid |
| 638 | 638 | // pid_t getppid(void); |
| 639 | 639 | // asmlinkage long sys_getppid(void); |
| 640 | | pub const getppid = @compileError("TODO: getppid"); |
| 640 | pub fn getppid() errno.Error!pid_t { |
| 641 | const r = syscall0(.getppid); |
| 642 | return switch (_errno(r)) { |
| 643 | .ok => @intCast(r), |
| 644 | _ => |c| errno.errorFromInt(@intFromEnum(c)), |
| 645 | }; |
| 646 | } |
| 641 | 647 | |
| 642 | 648 | // getpgrp |
| 643 | 649 | // pid_t getpgrp(void); |