Skip to content

Commit 178c95d

Browse files
authored
Rename Fork::Parent to Fork::ParentOf. (#1369)
This helps clarify that it holds the pid of the child, not the pid of the parent.
1 parent 72bc1d8 commit 178c95d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/backend/linux_raw/runtime/syscalls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub(crate) unsafe fn kernel_fork() -> io::Result<Fork> {
7373
))?;
7474

7575
Ok(if let Some(pid) = Pid::from_raw(pid) {
76-
Fork::Parent(pid)
76+
Fork::ParentOf(pid)
7777
} else {
7878
Fork::Child(Pid::from_raw_unchecked(child_pid.assume_init()))
7979
})

src/runtime.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,9 @@ pub use backend::runtime::tls::StartupTlsInfo;
352352

353353
/// `fork()`—Creates a new process by duplicating the calling process.
354354
///
355-
/// On success, the pid of the child process is returned in the parent, and
356-
/// `None` is returned in the child.
355+
/// On success, `Fork::ParentOf` containing the pid of the child process is
356+
/// returned in the parent, and `Fork::Child` containing the pid of the child
357+
/// process is returned in the child.
357358
///
358359
/// Unlike its POSIX and libc counterparts, this `fork` does not invoke any
359360
/// handlers (such as those registered with `pthread_atfork`).
@@ -447,7 +448,7 @@ pub enum Fork {
447448

448449
/// This is returned in the parent process after a `fork`. It holds the PID
449450
/// of the child.
450-
Parent(Pid),
451+
ParentOf(Pid),
451452
}
452453

453454
/// `execveat(dirfd, path.as_c_str(), argv, envp, flags)`—Execute a new

0 commit comments

Comments
 (0)