diff options
Diffstat (limited to 'src/syntax.h')
| -rw-r--r-- | src/syntax.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/syntax.h b/src/syntax.h index 80ab067..07d5437 100644 --- a/src/syntax.h +++ b/src/syntax.h @@ -1,5 +1,6 @@ # pragma once +#include <unistd.h> #include "utils.h" @@ -190,10 +191,20 @@ typedef struct { DECLARE_VEC(FdRedirect, FdRedirectVec) + +typedef struct { + int fd; + bool parent_proc_closable; + bool child_proc_closable; +} Channel; + +static const Channel STDIN_CHA = {.fd = STDIN_FILENO, .parent_proc_closable = false, .child_proc_closable = false}; +static const Channel STDOUT_CHA = {.fd = STDOUT_FILENO, .parent_proc_closable = false, .child_proc_closable = false}; + typedef struct { char** args; FdRedirectVec redirects; - int stdin_fd, stdout_fd; + Channel read_cha, write_cha; IntVec parent_open_fds; IntVec child_open_fds; } ExecutableCommand; |
