#include #include #include int main(int argc,char **argv) { int fd; int pip[2]; _pipe(pip, 0, 0); fd = dup(1); dup2(pip[1], 1); spawnl(_P_NOWAIT, "a.exe", "a.exe", NULL); close(1); dup2(fd, 1); close(fd); fd = dup(0); dup2(pip[0], 0); spawnl(_P_NOWAIT, "b.exe", "b.exe", NULL); close(0); dup2(fd, 0); close(fd); }