a*****n 发帖数: 439 | 1 #include
main()
{
printf("Maybe.\n");
execl("/bin/echo","echo","Always.\n",NULL);
printf("display?");
}
为什么display?不会被显示? | D****g 发帖数: 2860 | 2 man execl:
...
Each of the functions in the exec family replaces the
current process image with a new process image. The new
image is constructed from a regular, executable file called
the new process image file. This file is either an execut-
able object file or a file of data for an interpreter. There
is no return from a successful call to one of these func-
tions because the calling process image is overlaid by the
new process image.
【在 a*****n 的大作中提到】 : #include : main() : { : printf("Maybe.\n"); : execl("/bin/echo","echo","Always.\n",NULL); : printf("display?"); : } : 为什么display?不会被显示?
| a*****n 发帖数: 439 | 3 是不是说这个main
process在执行了execl以后,线程就被替换为echo,然后结束,无论execl后面有任何代码都
不会被执行?
谢了?
【在 D****g 的大作中提到】 : man execl: : ... : Each of the functions in the exec family replaces the : current process image with a new process image. The new : image is constructed from a regular, executable file called : the new process image file. This file is either an execut- : able object file or a file of data for an interpreter. There : is no return from a successful call to one of these func- : tions because the calling process image is overlaid by the : new process image.
| D****g 发帖数: 2860 | 4 correct.
【在 a*****n 的大作中提到】 : 是不是说这个main : process在执行了execl以后,线程就被替换为echo,然后结束,无论execl后面有任何代码都 : 不会被执行? : 谢了?
|
|