about summary refs log tree commit diff
path: root/src/libstd/sys/windows/c.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-04-16 09:44:05 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-05-16 11:13:38 -0700
commit1ec7a697328fb10e7135b87557ff0a5ea702dd8d (patch)
treec781f67fddaa59b5c6778b51acdaa8c85e6c69d4 /src/libstd/sys/windows/c.rs
parent5e535eae5c4b70879aefc050a5fe0b8137c07eac (diff)
downloadrust-1ec7a697328fb10e7135b87557ff0a5ea702dd8d.tar.gz
rust-1ec7a697328fb10e7135b87557ff0a5ea702dd8d.zip
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.
Diffstat (limited to 'src/libstd/sys/windows/c.rs')
-rw-r--r--src/libstd/sys/windows/c.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libstd/sys/windows/c.rs b/src/libstd/sys/windows/c.rs
index b07d063de45..e9b850856e1 100644
--- a/src/libstd/sys/windows/c.rs
+++ b/src/libstd/sys/windows/c.rs
@@ -482,6 +482,7 @@ extern "system" {
                                dwMilliseconds: libc::DWORD) -> libc::DWORD;
     pub fn SwitchToThread() -> libc::BOOL;
     pub fn Sleep(dwMilliseconds: libc::DWORD);
+    pub fn GetProcessId(handle: libc::HANDLE) -> libc::DWORD;
 }
 
 #[link(name = "userenv")]