diff options
author | Stefan Zabka <zabkaste@hu-berlin.de> | 2020-06-10 17:11:44 +0200 |
---|---|---|
committer | Stefan Zabka <zabkaste@hu-berlin.de> | 2020-06-10 17:11:44 +0200 |
commit | 5598f8300b9d3e7b49a4d3e65d1d837616b8beb5 (patch) | |
tree | 84fe96600f41f7d9a7b806edf8f27a3fbb82da4e /03_exercise/srv/process.h | |
parent | 47aaae2c42d554963fb811b68fdf28c9743598e8 (diff) | |
parent | d80bb89ceaee252cff304c3f7dcb160d3bee8fde (diff) | |
download | betriebssysteme-5598f8300b9d3e7b49a4d3e65d1d837616b8beb5.tar.gz betriebssysteme-5598f8300b9d3e7b49a4d3e65d1d837616b8beb5.zip |
Merge branch 'master' into threadpool
Diffstat (limited to '03_exercise/srv/process.h')
-rw-r--r-- | 03_exercise/srv/process.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/03_exercise/srv/process.h b/03_exercise/srv/process.h new file mode 100644 index 0000000..6e9208c --- /dev/null +++ b/03_exercise/srv/process.h @@ -0,0 +1,30 @@ +#ifndef SHELL_PROCESS_H +#define SHELL_PROCESS_H + +#include <stddef.h> +#include <stdbool.h> + +typedef struct { + char **argv; + size_t argc; + int in_fd; + int out_fd; + int pid; + bool blocking; +} process; + +/* + * Parses the given line and creates an array of processes at *processes + * Expects tail -F file | grep panic & to mean that both processes should + * run in the background + */ +int parse_line(char const *line, process **processes); + +/* + * returns the return code of the executed program + */ +int exec_command(process p); + +void free_processes(process **processes); + +#endif // SHELL_PROCESS_H |