cudd  3.0.0
The University of Colorado Decision Diagram Package
Macros | Functions
pipefork.c File Reference

Forks a command and sets up pipes to and from. More...

#include "config.h"
#include <unistd.h>
#include <stdio.h>
#include <sys/wait.h>
Include dependency graph for pipefork.c:

Macros

#define _POSIX_SOURCE
 
#define EXTERN   extern
 Allows C linkage when compiling as C++.
 

Functions

int util_pipefork (char *const *argv, FILE **toCommand, FILE **fromCommand, int *pid)
 Forks a command and sets up pipes to and from. More...
 

Detailed Description

Forks a command and sets up pipes to and from.

Author
Rick L Spickelmier
Richard Rudell

Function Documentation

◆ util_pipefork()

int util_pipefork ( char *const *  argv,
FILE **  toCommand,
FILE **  fromCommand,
int *  pid 
)

Forks a command and sets up pipes to and from.

Returns
1 for success, with toCommand and fromCommand pointing to the streams; 0 for failure
Parameters
argvnormal argv argument list
toCommandpointer to the sending stream
fromCommandpointer to the reading stream
pidprocess ID