diff options
| author | Thayne McCombs <astrothayne@gmail.com> | 2017-10-05 23:49:36 -0600 |
|---|---|---|
| committer | Thayne McCombs <astrothayne@gmail.com> | 2017-10-06 01:15:49 -0600 |
| commit | 6ff6b935608f7c5b6b53517f3fc5bafec911a79d (patch) | |
| tree | b0312b09d1013b9c73aa0011a339f1201569c52c /src/libstd/sys/unix | |
| parent | a4af9309d060b76ddaeb91c52d9f0e05dc97264c (diff) | |
Add current_pid function
Fixes #44971
Diffstat (limited to 'src/libstd/sys/unix')
| -rw-r--r-- | src/libstd/sys/unix/os.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libstd/sys/unix/os.rs b/src/libstd/sys/unix/os.rs index 5ef98d24710..132f59b999d 100644 --- a/src/libstd/sys/unix/os.rs +++ b/src/libstd/sys/unix/os.rs @@ -513,3 +513,7 @@ pub fn home_dir() -> Option<PathBuf> { pub fn exit(code: i32) -> ! { unsafe { libc::exit(code as c_int) } } + +pub fn getpid() -> u32 { + unsafe { libc::getpid() as u32 } +} |
