Question 10
A: Under what circumstance might a call to fork() fail
在什么情况下使用fork()函数的时候会失败
答案:
- 系统层面的进程数量限制
- 用户进程的进程数量限制
- Swap space空间不足以创建新进程
B: execve() can return (fail) if
在什么情况下execve()函数会返回fail
答案:
- 目标文件不存在
- 目标文件不能够被终结
- 进程过于庞大
- path, argv, envp 是无效的指针
- //详细见 man 2 execve 界面
C: What should the calling program do if execve() return
答案:
- the attempt to transform into the new process failed
- the execising progress should print an error message and terminate