use of setsid()?

Hi,

What exactly is the use of a setsid()?

I notice that when I call a setsid() in the child's part of code, and run the program and do a 'ps -al' there is only one process in the list that is running (which I believe is the child, correct me if I'm wrong).

How does making the child the process group leader, remove the parent process altogether?

I wasn't able to find answers to my satisfaction in a google search, I'd really appreciate if someone could help me out with this!


Thanks,
DeepBlack
If I understand it correctly ps -al will not show session leaders so I don't believe that it is the child process that you see. Why don't you print the process ID from the child process and compare it to the list.
Topic archived. No new replies allowed.