Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bf06e43

Browse files
committedJun 24, 2024
document safety properties of the internal Process::new constructor
1 parent 9212236 commit bf06e43

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎std/src/sys/pal/unix/process/process_unix.rs

+6
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,12 @@ pub struct Process {
877877

878878
impl Process {
879879
#[cfg(target_os = "linux")]
880+
/// # Safety
881+
///
882+
/// `pidfd` must either be -1 (representing no file descriptor) or a valid, exclusively owned file
883+
/// descriptor (See [I/O Safety]).
884+
///
885+
/// [I/O Safety]: crate::io#io-safety
880886
unsafe fn new(pid: pid_t, pidfd: pid_t) -> Self {
881887
use crate::os::unix::io::FromRawFd;
882888
use crate::sys_common::FromInner;

0 commit comments

Comments
 (0)
Failed to load comments.