进程小问题
#include<stdio.h>
int main()
{ int pid;
pid=fork();
if(pid==0) {
printf("I am the child.\n");
execl("/bin/ls¡±,¡±ls",0);
perror("exec error.\n");
}
else if(pid>0)
printf("I am the parent.\n");
else printf("fork failed.\n");
printf("program end.\n");
return 0;
}
编译时出现的错误:
cc -o exe-os131 os131.c
os131.c: In function ‘main’:
os131.c:8: warning: not enough variable arguments to fit a sentinel
请教一下,该如何解决??