程序执行问题?

#include <spawn.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <process.h>
#include <sys/wait.h>

main(int argc, char **argv)
{
char *args[] = { “c:/lt_work/child”, NULL };
int i, status;
pid_t pid;
struct inheritance inherit;

// create 3 child processes
for (i = 0; i < 3; i++) {
inherit.flags = 0;
if ((pid = spawn(“c:/lt_work/child”, 0, NULL, &inherit, args, environ)) == -1)
perror(“spawn() failed”);
else
printf("spawned child, pid = %d
", pid);
}

while (1) {
if ((pid = wait(&status)) == -1) {
perror(“wait() failed (no more child processes?)”);
exit(EXIT_FAILURE);
}
printf("a child terminated, pid = %d
", pid);

if (WIFEXITED(status)) {
printf("child terminated normally, exit status = %d
",
WEXITSTATUS(status));
} else if (WIFSIGNALED(status)) {
printf("child terminated abnormally by signal = %X
",
WTERMSIG(status));
} // else see documentation for wait() for more macros
}
}
执行这个程序,提示spawn() failed: no such file or directory
不知道是哪里的问题 :confused:

我犯了一个愚蠢的错误,把路径写成windows下的了,应该是QNX下的。:slight_smile: