coprocess(3)
π NAME π
coprocv, coprocvp, coprocvpe, coprocs, coprocsp β ok bestie, these are the girlies that execute a command in coprocessing mode. Yes we're in coprocess(3), straight out of the Linux Programmer's Manual, and she is serving π
β¨
πΈ 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, bestie, don't forget it or you're getting nothing π«Ά
π DESCRIPTION π
So the whole point: these functions run commands in coprocessing mode. They all do the same vibe, they just differ in the way you specify the executable file to run and its parameters.
Every single one of them:
- defines two pipes (by
pipe(2)), - creates a new process by
fork(2), - redirects the standard input and standard output of that new process into the two pipes,
- and execs a program by one of the
exec(3)functions.
The way that the calling program controls both the standard input and the standard output of the called process?? Iconic, honestly. Writing to pipefd[1] feeds input to the coprocess, while the coprocess output can be retrieved from pipefd[0]. That's the whole dynamic β you talk in through [1], you listen out through [0]. Two-way relationship, we love to see it π¦
Now for the family tree: 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.
ngl bestie, that's literally how the page prints it βcoprocspshows up twice in that list and it lands onexecsptwice at the end. I'm not touching it, no cap, I report the text exactly as she is π
π BUGS π
Found something cursed? Bug reports should be addressed to <info@virtualsquare.org>. Tell them everything, they wanna know π
π AUTHOR π
Renzo Davoli <renzo@cs.unibo.it> β the main character who wrote all this π
And that's the whole page, bestie. This one came from VirtualSquare, dated 2014-05-27, and it lives at coprocess(3) β go pipe something into something else, you've got this π
β¨π
π¦ where this page comes from
- debian bookworm: libexecs-dev 1.3-2 Β· LGPL-2.1-or-later
- debian trixie: libexecs-dev 1.4-2+b2 Β· LGPL-2.1-or-later
- ubuntu jammy: libexecs-dev 1.3-1 Β· LGPL-2.1-or-later
- ubuntu noble: libexecs-dev 1.4-2build1 Β· LGPL-2.1-or-later
- ubuntu questing: libexecs-dev 1.4-2build1
- ubuntu resolute: libexecs-dev 1.4-2build2 Β· LGPL-2.1-or-later
- ubuntu stonking: libexecs-dev 1.4-2build2 Β· LGPL-2.1-or-later
- Copyright (C) 2014 Renzo Davoli. University of Bologna. <renzo@cs.unibo.it>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms