OPENWRITEPIPE(3A) OPENWRITEPIPE(3A)
NAME
OpenWritePipe, OpenWritePipeV - open a pipe for writing
SYNOPSIS
int OpenWritePipe (func, arg, cmd, arg ...)
int (*func)();
int arg;
char *cmd;
char *arg;
int OpenWritePipeV (func, arg, cmd, argv)
int (*func)();
int arg;
char *cmd;
char **argv;
DESCRIPTION
OpenWritePipe opens a pipe for writing. Cmd points to the
full pathname of the command, and its arguments (starting
with arg as argument zero) follow cmd in a NULL-terminated
parameter list. The file descriptor to which to write is in
returned. -1 is returned on failure.
OpenWritePipeV is like OpenWritePipe, except that it accepts
a vector argv as an array of arguments.
The file descriptor should be attached to an I/O procedure
using AddIoProc(3A) for asynchronous operation. For
synchronous operation, the pipe can be written to using the
write(2) system call, or it can be attached to a standard
I/O file pointer using fdopen (3). When the pipe exits, func
is called as follows:
func (arg, pid, status)
int arg;
int pid;
int status;
The argument arg is the same as that passed to OpenWritePipe
Page 1 (printed 9/3/91)
OPENWRITEPIPE(3A) OPENWRITEPIPE(3A)
or OpenWritePipeV. The pid and status are the process ID
and exit status of the command.
SEE ALSO
write(2), fdopen(3), XtAppAddInput(3Xt), OpenReadPipe(3A),
OpenFilter(3A), GetPipePid(3A), ClosePipe(3A),
AddIoProc(3A), RemoveIoProc(3A)
Page 2 (printed 9/3/91)