|
LIBRARY#include <xtend/proc.h> -lxtend SYNOPSISint spawnlp(int parent_action, int echo, char *infile, char *outfile, char *errfile, char *arg0, ...) ARGUMENTSparent_action: P_WAIT or P_NOWAIT echo: P_ECHO or P_NOECHO infile: File to which stdin of child is redirected or NULL outfile: File to which stdout of child is redirected or NULL errfile: File to which stderr of child is redirected or NULL DESCRIPTIONspawnvp() and spawnlp() are wrappers around fork(2) and exec(3) which make it easy to run a child process without an intermediate shell process as is used by system(3). The spawnlp() function spawns a child process using a variable argument list. The 6th argument is passed to argv[0] of the child, the 7th to argv[1], etc.The spawnvp() function spawns a process using the command contained in an argv[] array constructed by the caller. spawnlp() automatically constructs such an argv[] array and calls spawnvp(). The calling process waits for the child to complete if P_WAIT is passed to parent_action, or continues immediately if P_NOWAIT is passed. If P_ECHO is passed as the echo argument, the command is echoed, the command is echoed to the parent's stdout. If infile, outfile, or errfile are not NULL, then the corresponding file streams stdin, stdout, or stderr are redirected to the filename provided. RETURN VALUESThe exit status of the child process if P_WAIT is passed The PID of the child process if P_NOWAIT is passedSEE ALSOspawnvp(3), fork(2), exec(3) Visit the GSP FreeBSD Man Page Interface. |