Skip to content

Commit feb5227

Browse files
joshtriplettsunfishcode
authored andcommitted
Clarify getppid documentation: explain how None can occur (#1209)
The `getppid` syscall can never fail, but rustix returns PID 0 as `None`.
1 parent 81021ad commit feb5227

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: src/process/id.rs

+3
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ pub fn getpid() -> Pid {
113113

114114
/// `getppid()`—Returns the parent process' ID.
115115
///
116+
/// This will return `None` if the current process has no parent (or no parent accessible in the
117+
/// current PID namespace), such as if the current process is an init process (PID 1).
118+
///
116119
/// # References
117120
/// - [POSIX]
118121
/// - [Linux]

0 commit comments

Comments
 (0)