Scroll to navigation

coprocess(3) Linux Programmer's Manual coprocess(3)

NAME

coprocv, coprocvp, coprocvpe, coprocs, coprocsp - execute a command in coprocessing mode

SYNOPSIS

#include <execs.h>

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]);

These functions are provided by libexecs. Link with -lexecs.

DESCRIPTION

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.

BUGS

Bug reports should be addressed to <info@virtualsquare.org>

AUTHOR

Renzo Davoli <renzo@cs.unibo.it>

2014-05-27 VirtualSquare