diff options
author | Alexander Færøy <ahf@torproject.org> | 2018-11-22 05:22:24 +0100 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-12-17 16:39:28 -0500 |
commit | 89393a77e5db804784d4f08ef67fd2831799d65b (patch) | |
tree | bc6560f11c60d944b6b220ce0349469bf0c6ca4a /src/lib/process/process_win32.c | |
parent | bb784cf4f36256a8276ba60641d3ff766b9cd9df (diff) | |
download | tor-89393a77e5db804784d4f08ef67fd2831799d65b.tar.gz tor-89393a77e5db804784d4f08ef67fd2831799d65b.zip |
Add process_get_pid() to the Process subsystem.
This patch adds support for getting the unique process identifier from a
given process_t. This patch implements both support for both the Unix
and Microsoft Windows backend.
See: https://bugs.torproject.org/28179
Diffstat (limited to 'src/lib/process/process_win32.c')
-rw-r--r-- | src/lib/process/process_win32.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/process/process_win32.c b/src/lib/process/process_win32.c index a019e0b4f3..3e97f37801 100644 --- a/src/lib/process/process_win32.c +++ b/src/lib/process/process_win32.c @@ -271,6 +271,16 @@ process_win32_exec(process_t *process) return PROCESS_STATUS_RUNNING; } +/** Returns the unique process identifier for the given <b>process</b>. */ +process_pid_t +process_win32_get_pid(process_t *process) +{ + tor_assert(process); + + process_win32_t *win32_process = process_get_win32_process(process); + return (process_pid_t)win32_process->process_information.dwProcessId; +} + /** Schedule an async write of the data found in <b>buffer</b> for the given * process. This function runs an async write operation of the content of * buffer, if we are not already waiting for a pending I/O request. Returns the |