- 论坛徽章:
- 0
|
回复 #1 danielhf 的帖子
没看到第一个问题 
第一个问题我想其实很简单,就是为了保证不跟setsid的定义冲突
setsid() creates a new session if the calling process is not a process group leader. The calling process is the leader of the new session, the process group leader of the new process group, and has no controlling tty. The process group ID and session ID of the calling process are set to the PID of the calling process. The calling process will be the only process in this new process group and in this new session.
其定义要求调用返回后这个进程是新的group和session中唯一的进程
所以如果调用者已经是一个group leader了,那就没法保证这个group中有没有其他进程(如果group中有其他进程怎么办?难不成kill掉?) |
|