lkml.org 
[lkml]   [1996]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: setsid() semantics changed...
Date
From
>Reading this carefully, I see that the current Linux behaviour _is_
>Posix compliant; read the first line after EPERM again. It says
>"The calling process is already a process group leader". So what I did,
>calling "setpgrp(0, getpgid(getppid()))" first is indeed the right thing
>to do if you really want to setsid(). I still think it doesn't make sense,
>but.. I'll attribute a section to the setsid() manpage about this if
>you want ;) (what is the latest version?)

Included below is a warning from the setsid(2) manpage for
Solaris. Something like this should be included in the linux man
page.

WARNINGS
A call to setsid() by a process that is a process group
leader will fail. A process can become a process group
leader by being the last member of a pipeline started by a
job control shell. Thus, a process that expects to be part
of a pipeline, and that calls setsid(), should always first
fork; the parent should exit and the child should call set-
sid(). This will ensure that the calling process will work
reliably when started by both job control shells and non-job
control shells.
--
Michiel Boland <boland@sci.kun.nl>
University of Nijmegen
The Netherlands


\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.039 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site