coprocve3
Execute a command in coprocessing mode
Part of coprocess(3).
Usage
pid_t coprocv(const
char
*path,
char
*const
argv
[]
,
int
pipefd
[2]
);
pid_t coprocve(const
char
*path,
char
*const
argv
[]
,
char *const
envp
[]
,
int
pipefd
[2]
);
pid_t coprocvp(const
char
*file,
char
*const
argv
[]
,
int
pipefd
[2]
);
pid_t coprocvpe(const
char
*file,
char
*const
argv
[]
,
char *const
envp
[]
,
int
pipefd
[2]
);
pid_t coprocs(const
char
*path,
const
char
*command,
int
pipefd
[2]
);
pid_t coprocse(const
char
*path,
const
char
*command,
char *const
envp
[]
,
int
pipefd
[2]
);
pid_t coprocsp(const
char
*command,
int
pipefd
[2]
);
pid_t coprocspe(const
char
*command,
char
*const
envp
[]
,
int pipefd
[2]
);
Overview
These functions run commands in coprocessing mode. They differs in the way to specify the executable file to run and its parameters. All of them define two pipes (by pipe(2)), create a new process by fork(2), redirect the standard input and output of the new process in the two pipes, and exec a program by one of the exec(3) functions.
The calling program controls both the standard input and the standard output of the called process: writing to pipefd[1] provides input to the coprocess while the coprocess output can be retrieved from pipefd[0].
coprocv, coprocve, coprocvp, coprocvpe, coprocs, coprocse, coprocsp, and coprocsp differ as they define the executable file to run and its arguments as execv, execve, execvp, execvpe, execs, execse, execsp, and execsp, respectively.
History
- Debian 13 (Trixie) to Debian 11 (Bullseye): the text shown here
- Debian 10 (Buster)