10 |
|
|
11 |
|
#include "copyright.h" |
12 |
|
|
13 |
– |
#include <sys/types.h> |
13 |
|
#include <sys/wait.h> |
15 |
– |
#include <fcntl.h> |
14 |
|
#include <stdlib.h> |
15 |
|
|
16 |
|
#include "rtprocess.h" |
35 |
|
return(0); |
36 |
|
if (pipe(p0) < 0 || pipe(p1) < 0) |
37 |
|
return(-1); |
38 |
< |
if ((pd->pid = fork()) == 0) { /* if child... */ |
38 |
> |
#ifdef BSD |
39 |
> |
if (compath != NULL) |
40 |
> |
pd->pid = vfork(); /* more efficient with exec() */ |
41 |
> |
else |
42 |
> |
#endif |
43 |
> |
pd->pid = fork(); |
44 |
> |
if (pd->pid == 0) { /* if child... */ |
45 |
|
close(p0[1]); |
46 |
|
close(p1[0]); |
47 |
|
if (p0[0] != 0) { /* connect p0 to stdin */ |