Re: setsid() semantics changed...

Michiel Boland (
Sun, 14 Jul 1996 13:01:57 +0200

>Now a process that gets spawned by a shell that sets up the process group
>for it (so it's the leader of it's own group, not session) cannot do
>a setsid() anymore because the "if (p->pgrp == current->pid)" check will
>match on itself.

Any program that does a setsid() should fork first, because
shells that do the above get horribly confused by programs that
call setsid() and are still under the shell's control.

Ergo: I personally do not think that the new semantics are wrong.

>But that could easily break POSIX conformance, I don't know...

It does break POSIX, at least, if what Stevens says in APitUE
(my substitute for POSIX :) is correct:

pid_t setsid(void);
This function returns an error if the caller is already a
process group leader.

Michiel Boland <>
University of Nijmegen
The Netherlands