Windows: Implement start_command().
On Windows, we have spawnv() variants to run a child process instead of fork()/exec(). In order to attach pipe ends to stdin, stdout, and stderr, we have to use this idiom: save1 = dup(1); dup2(pipe[1], 1); spawnv(); dup2(save1, 1); close(pipe[1]); assuming that the descriptors created by pipe() are not inheritable. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
This commit is contained in:
@ -165,3 +165,11 @@ sig_handler_t mingw_signal(int sig, sig_handler_t handler);
|
||||
#define is_dir_sep(c) ((c) == '/' || (c) == '\\')
|
||||
#define PATH_SEP ';'
|
||||
#define PRIuMAX "I64u"
|
||||
|
||||
/*
|
||||
* helpers
|
||||
*/
|
||||
|
||||
char **copy_environ(void);
|
||||
void free_environ(char **env);
|
||||
char **env_setenv(char **env, const char *name);
|
||||
|
Reference in New Issue
Block a user