---
name: "coprocve"
section: "3"
platform: "linux"
package: "libexecs-dev"
version: "1.4-2+b2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/coprocess"
---

# coprocve(3)

execute a command in coprocessing mode

Part of [coprocess(3)](/coprocess/3.md).

## 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)](/pipe/2.md)), create a new process by  [**fork**(2)](/fork/2.md), redirect the standard input and output of the new process  in the two pipes, and exec a program by one of the [**exec**(3)](/exec/3.md) 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\>
