Skip to content

Commit

Permalink
document safety properties of the internal Process::new constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
the8472 committed Jun 24, 2024
1 parent 9212236 commit bf06e43
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions std/src/sys/pal/unix/process/process_unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,12 @@ pub struct Process {

impl Process {
#[cfg(target_os = "linux")]
/// # Safety
///
/// `pidfd` must either be -1 (representing no file descriptor) or a valid, exclusively owned file
/// descriptor (See [I/O Safety]).
///
/// [I/O Safety]: crate::io#io-safety
unsafe fn new(pid: pid_t, pidfd: pid_t) -> Self {
use crate::os::unix::io::FromRawFd;
use crate::sys_common::FromInner;
Expand Down

0 comments on commit bf06e43

Please sign in to comment.