| ... | @@ -637,7 +637,13 @@ pub const setpgid = @compileError("TODO: setpgid"); | ... | @@ -637,7 +637,13 @@ pub const setpgid = @compileError("TODO: setpgid"); |
| 637 | // getppid | 637 | // getppid |
| 638 | // pid_t getppid(void); | 638 | // pid_t getppid(void); |
| 639 | // asmlinkage long sys_getppid(void); | 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 | // getpgrp | 648 | // getpgrp |
| 643 | // pid_t getpgrp(void); | 649 | // pid_t getpgrp(void); |