document safety properties of the internal Process::new constructor
This commit is contained in:
parent
6687a3f7da
commit
0ce361938e
1 changed files with 6 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue