summaryrefslogtreecommitdiff
path: root/src/dged/process.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/dged/process.h')
-rw-r--r--src/dged/process.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/dged/process.h b/src/dged/process.h
new file mode 100644
index 0000000..cefec8c
--- /dev/null
+++ b/src/dged/process.h
@@ -0,0 +1,35 @@
+#ifndef _PROCESS_H
+#define _PROCESS_H
+
+#include <stdbool.h>
+#include <stdint.h>
+
+#ifdef _WIN32
+typedef HANDLE fd_t;
+#else
+typedef int fd_t;
+#endif
+
+struct platform_process;
+struct process {
+ uint64_t id;
+ fd_t stdin;
+ fd_t stdout;
+ fd_t stderr;
+ struct platform_process *impl;
+};
+
+struct process_create_result {
+ bool ok;
+ const char *error_message;
+};
+
+struct process_create_result process_create(char *const command[],
+ struct process *result);
+
+void process_destroy(struct process *p);
+
+bool process_running(const struct process *p);
+bool process_kill(const struct process *p);
+
+#endif