aboutsummaryrefslogtreecommitdiffhomepage
path: root/exec.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-01-07 18:07:06 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-01-07 18:07:06 -0800
commit7864d0d416519774c614148920530bc7da4a3e3b (patch)
treea2fab74e5d3145349440d098d4cfc00363a3284c /exec.h
parentd1feb9bcbf141e2195f37a8ab0f526c24a533cda (diff)
Rework file descriptor handling
Remove global array of file descriptors, in favor of relying on CLO_EXEC exclusively. Also correctly implement "pipe avoidance" so that fd redirections do not conflict with pipes.
Diffstat (limited to 'exec.h')
-rw-r--r--exec.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/exec.h b/exec.h
index 10eda29b..f0a0e148 100644
--- a/exec.h
+++ b/exec.h
@@ -60,22 +60,16 @@ int exec_subshell(const wcstring &cmd, bool preserve_exit_status);
/**
Loops over close until the syscall was run without being
- interrupted. Then removes the fd from the open_fds list.
+ interrupted.
*/
void exec_close(int fd);
/**
- Call pipe(), and add resulting fds to open_fds, the list of opend
- file descriptors for pipes.
+ Call pipe(), and add resulting fds to open_fds, the list of opened
+ file descriptors for pipes. The pipes are marked CLO_EXEC.
*/
int exec_pipe(int fd[2]);
-/* Close all fds in open_fds. This is called from postfork.cpp */
-void close_unused_internal_pipes(const io_chain_t &io);
-
-/* Gets all unused internal pipes into fds */
-void get_unused_internal_pipes(std::vector<int> &fds, const io_chain_t &io);
-
/** Gets the interpreter for a given command */
char *get_interpreter(const char *command, char *interpreter, size_t buff_size);