MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / pidfd_open

Function pidfd_open

src/backend/libc/process/syscalls.rs:608–621  ·  view source on GitHub ↗
(pid: Pid, flags: PidfdFlags)

Source from the content-addressed store, hash-verified

606
607#[cfg(target_os = "linux")]
608pub(crate) fn pidfd_open(pid: Pid, flags: PidfdFlags) -> io::Result<OwnedFd> {
609 syscall! {
610 fn pidfd_open(
611 pid: c::pid_t,
612 flags: c::c_uint
613 ) via SYS_pidfd_open -> c::c_int
614 }
615 unsafe {
616 ret_owned_fd(pidfd_open(
617 pid.as_raw_nonzero().get(),
618 bitflags_bits!(flags),
619 ))
620 }
621}
622
623#[cfg(target_os = "linux")]
624pub(crate) fn pidfd_send_signal(pidfd: BorrowedFd<'_>, sig: Signal) -> io::Result<()> {

Callers

nothing calls this directly

Calls 3

ret_owned_fdFunction · 0.50
getMethod · 0.45
as_raw_nonzeroMethod · 0.45

Tested by

no test coverage detected