Sha256: e4b4dcc7e5b2a1e3e68ce03ce9a5dde43108dae4ddbc443488c464194738d06f

Contents?: true

Size: 1.58 KB

Versions: 8

Compression:

Stored size: 1.58 KB

Contents

use crate::process::Pid;
use crate::{backend, io};

pub use backend::process::types::Signal;

/// `kill(pid, sig)`—Sends a signal to a process.
///
/// # References
///  - [POSIX]
///  - [Linux]
///
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/kill.html
/// [Linux]: https://man7.org/linux/man-pages/man2/kill.2.html
#[inline]
#[doc(alias = "kill")]
pub fn kill_process(pid: Pid, sig: Signal) -> io::Result<()> {
    backend::process::syscalls::kill_process(pid, sig)
}

/// `kill(-pid, sig)`—Sends a signal to all processes in a process group.
///
/// If `pid` is 1, this sends a signal to all processes the current process
/// has permission to send signals to, except process `1`, possibly other
/// system-specific processes, and on some systems, the current process.
///
/// # References
///  - [POSIX]
///  - [Linux]
///
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/kill.html
/// [Linux]: https://man7.org/linux/man-pages/man2/kill.2.html
#[inline]
#[doc(alias = "kill")]
pub fn kill_process_group(pid: Pid, sig: Signal) -> io::Result<()> {
    backend::process::syscalls::kill_process_group(pid, sig)
}

/// `kill(0, sig)`—Sends a signal to all processes in the current process
/// group.
///
/// # References
///  - [POSIX]
///  - [Linux]
///
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/kill.html
/// [Linux]: https://man7.org/linux/man-pages/man2/kill.2.html
#[inline]
#[doc(alias = "kill")]
pub fn kill_current_process_group(sig: Signal) -> io::Result<()> {
    backend::process::syscalls::kill_current_process_group(sig)
}

Version data entries

8 entries across 7 versions & 1 rubygems

Version Path
wasmtime-8.0.0 ./ext/cargo-vendor/rustix-0.36.12/src/process/kill.rs
wasmtime-7.0.0 ./ext/cargo-vendor/rustix-0.36.11/src/process/kill.rs
wasmtime-7.0.0 ./ext/cargo-vendor/rustix-0.37.5/src/process/kill.rs
wasmtime-6.0.1 ./ext/cargo-vendor/rustix-0.36.8/src/process/kill.rs
wasmtime-6.0.0 ./ext/cargo-vendor/rustix-0.36.8/src/process/kill.rs
wasmtime-5.0.0 ./ext/cargo-vendor/rustix-0.36.7/src/process/kill.rs
wasmtime-0.4.1 ./ext/cargo-vendor/rustix-0.36.5/src/process/kill.rs
wasmtime-0.4.0 ./ext/cargo-vendor/rustix-0.36.5/src/process/kill.rs