diff options
author | Niklas Halle <niklas@niklashalle.net> | 2020-06-01 15:46:28 +0200 |
---|---|---|
committer | Niklas Halle <niklas@niklashalle.net> | 2020-06-01 15:46:50 +0200 |
commit | 74abc79434fe895d0ca863e4d1d6c5c16b54f296 (patch) | |
tree | c0fcf720bf72c6cd348ce6b8a3063861918fc609 /03_exercise/srv/process.h | |
parent | 85131d8acfca55810205af625d65358f006f3de7 (diff) | |
download | betriebssysteme-74abc79434fe895d0ca863e4d1d6c5c16b54f296.tar.gz betriebssysteme-74abc79434fe895d0ca863e4d1d6c5c16b54f296.zip |
trying to connect server and shell, weird
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 |