Skip to main content

sys_getpid

Function sys_getpid 

Source
pub fn sys_getpid() -> usize
Available on Unix and crate feature sys-syscall and crate feature sys-unix and crate feature sys only.
Expand description

获取当前进程 ID。

§Feature Requirement

需要启用 "sys-unix" 特性。

§Examples

use lib_unknown::sys::unix::syscall::sys_getpid;

let pid = sys_getpid();
assert!(pid > 0);