]> git.lizzy.rs Git - rust.git/commit
std: Add an unstable method Child::id
authorAlex Crichton <alex@alexcrichton.com>
Thu, 16 Apr 2015 16:44:05 +0000 (09:44 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Sat, 16 May 2015 18:13:38 +0000 (11:13 -0700)
commit1ec7a697328fb10e7135b87557ff0a5ea702dd8d
treec781f67fddaa59b5c6778b51acdaa8c85e6c69d4
parent5e535eae5c4b70879aefc050a5fe0b8137c07eac
std: Add an unstable method Child::id

This commits adds a method to the `std::process` module to get the process
identifier of the child as a `u32`. On Windows the underlying identifier is
already a `u32`, and on Unix the type is typically defined as `c_int` (`i32` for
almost all our supported platforms), but the actually pid is normally a small
positive number.

Eventually we may add functions to load information about a process based on its
identifier or the ability to terminate a process based on its identifier, but
for now this function should enable this sort of functionality to exist outside
the standard library.
src/libstd/process.rs
src/libstd/sys/unix/process.rs
src/libstd/sys/windows/c.rs
src/libstd/sys/windows/process.rs