From 1b6a04ca5504955c571d1c97504fb45ea0befee4 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Mon, 8 Jan 2024 01:21:28 +0400 Subject: Initial vendor packages Signed-off-by: Valentin Popov --- vendor/rustix/src/backend/libc/pid/mod.rs | 1 + vendor/rustix/src/backend/libc/pid/syscalls.rs | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 vendor/rustix/src/backend/libc/pid/mod.rs create mode 100644 vendor/rustix/src/backend/libc/pid/syscalls.rs (limited to 'vendor/rustix/src/backend/libc/pid') diff --git a/vendor/rustix/src/backend/libc/pid/mod.rs b/vendor/rustix/src/backend/libc/pid/mod.rs new file mode 100644 index 0000000..ef944f0 --- /dev/null +++ b/vendor/rustix/src/backend/libc/pid/mod.rs @@ -0,0 +1 @@ +pub(crate) mod syscalls; diff --git a/vendor/rustix/src/backend/libc/pid/syscalls.rs b/vendor/rustix/src/backend/libc/pid/syscalls.rs new file mode 100644 index 0000000..d0ed4bc --- /dev/null +++ b/vendor/rustix/src/backend/libc/pid/syscalls.rs @@ -0,0 +1,14 @@ +//! libc syscalls for PIDs + +use crate::backend::c; +use crate::pid::Pid; + +#[cfg(not(target_os = "wasi"))] +#[inline] +#[must_use] +pub(crate) fn getpid() -> Pid { + unsafe { + let pid = c::getpid(); + Pid::from_raw_unchecked(pid) + } +} -- cgit v1.2.3