Subject: Re: session ID changes
To: matthew green <mrg@eterna.com.au>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-kern
Date: 02/15/1998 12:57:48
On Sun, 15 Feb 1998 20:21:35 +1100 
 matthew green <mrg@eterna.com.au> wrote:

 > can you check the posix definition of getsid() ?  it certainly was different
 > to what the x/open stuff now says a few years back.  it didn't meantion
 > process groups or pgid's, but "session ids" which were only guarenteed to
 > be unique across sessions (see posix for a definition of "sessions".)  this
 > usage and definition seems to be quite conflicting to me... one session can
 > have several process groups attached to it.
 > 
 > hmm... i notice that solaris 2.6's getsid() conforms to x/open while the
 > 2.5 one conforms to my memory of the posix getsid.

XPG4.2 has adoped POSIX.  The implentation in NetBSD conforms to the
unique session ID requirement of POSIX, which is really the same in XPG.

Note that the session ID is assigned at session creation as the PID of the
session leader (which also happens to be the PGID of the session leader's
process group).  When new PIDs are assigned, a check is made to see if
it conflicts w/ an existing session ID, and if it does, that PID is skipped,
similar to how checks for conflicting PGIDs are performed.

Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                            Home: +1 408 866 1912
NAS: M/S 258-5                                       Work: +1 650 604 0935
Moffett Field, CA 94035                             Pager: +1 415 428 6939