The golang library function os.StartProcess()
calls setpgid(0,0)
in the child process after forking.
It does this on the "linux" and "bsd" configurations, sources here: http://golang.org/src/pkg/syscall/exec_bsd.go?h=SYS_SETPGID#L105 http://golang.org/src/pkg/syscall/exec_linux.go?h=SYS_SETPGID#L117
I noticed in the past that the OSX Foundation library NSTask - (void)launch
method does the same thing (undocumented). At that time it seemed like an annoyance as it makes it harder to manage trees of processes.
What is the benefit of these libraries doing this automatically?