summaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-11-25 16:00:31 -0500
committerNick Mathewson <nickm@torproject.org>2011-11-25 16:00:31 -0500
commit093e6724c7c64c4472cf5426db0e34b650aa2f44 (patch)
tree2d53ac74ba6a9b261050c1b53fe360d42f4f3fba /src/common/util.h
parentcb8059b42dddf25cdfc516a0e7fa869f2b727aee (diff)
parentd4ba301f29752bc533e59f508417ab1053b05d12 (diff)
downloadtor-093e6724c7c64c4472cf5426db0e34b650aa2f44.tar.gz
tor-093e6724c7c64c4472cf5426db0e34b650aa2f44.zip
Merge remote-tracking branch 'asn/bug3472_act2'
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/common/util.h b/src/common/util.h
index b8725740c7..a9002254e7 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -356,10 +356,14 @@ void write_pidfile(char *filename);
void tor_check_port_forwarding(const char *filename,
int dir_port, int or_port, time_t now);
-int tor_terminate_process(pid_t pid);
typedef struct process_handle_s process_handle_t;
int tor_spawn_background(const char *const filename, const char **argv,
- const char **envp, process_handle_t *process_handle);
+#ifdef MS_WINDOWS
+ LPVOID envp,
+#else
+ const char **envp,
+#endif
+ process_handle_t *process_handle);
#define SPAWN_ERROR_MESSAGE "ERR: Failed to spawn background process - code "
@@ -367,9 +371,6 @@ int tor_spawn_background(const char *const filename, const char **argv,
HANDLE load_windows_system_library(const TCHAR *library_name);
#endif
-#ifdef UTIL_PRIVATE
-/* Prototypes for private functions only used by util.c (and unit tests) */
-
/* Values of process_handle_t.status. PROCESS_STATUS_NOTRUNNING must be
* 0 because tor_check_port_forwarding depends on this being the initial
* statue of the static instance of process_handle_t */
@@ -412,6 +413,15 @@ ssize_t tor_read_all_from_process_stderr(
const process_handle_t *process_handle, char *buf, size_t count);
char *tor_join_win_cmdline(const char *argv[]);
+int tor_process_get_pid(process_handle_t *process_handle);
+
+int tor_terminate_process(process_handle_t *process_handle);
+void tor_process_handle_destroy(process_handle_t *process_handle,
+ int also_terminate_process);
+
+#ifdef UTIL_PRIVATE
+/* Prototypes for private functions only used by util.c (and unit tests) */
+
void format_helper_exit_status(unsigned char child_state,
int saved_errno, char *hex_errno);