diff options
| author | Steven Fackler <sfackler@gmail.com> | 2017-11-18 21:09:18 -0800 |
|---|---|---|
| committer | Steven Fackler <sfackler@gmail.com> | 2017-11-19 12:36:55 -0800 |
| commit | 1e42d5f2e1ab05f0f5d07f7c09644574c13e9a12 (patch) | |
| tree | 6a6c38069754f63075dfa36a1ea8130dbd8e291c /src/libstd/sys/unix/ext/process.rs | |
| parent | 6160040d8547222e761ad876cbe3a48c9c90a5bf (diff) | |
| download | rust-1e42d5f2e1ab05f0f5d07f7c09644574c13e9a12.tar.gz rust-1e42d5f2e1ab05f0f5d07f7c09644574c13e9a12.zip | |
Add process::parent_id
I have this as a Unix-only API since it seems like Windows doesn't have a similar API.
Diffstat (limited to 'src/libstd/sys/unix/ext/process.rs')
| -rw-r--r-- | src/libstd/sys/unix/ext/process.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libstd/sys/unix/ext/process.rs b/src/libstd/sys/unix/ext/process.rs index cde21b089a2..60309bec6d4 100644 --- a/src/libstd/sys/unix/ext/process.rs +++ b/src/libstd/sys/unix/ext/process.rs @@ -191,3 +191,9 @@ impl IntoRawFd for process::ChildStderr { self.into_inner().into_fd().into_raw() } } + +/// Returns the OS-assigned process identifier associated with this process's parent. +#[unstable(feature = "unix_ppid", issue = "46104")] +pub fn parent_id() -> u32 { + ::sys::os::getppid() +} |
