[Xorp-hackers] About op command!

Bruce M Simpson bms at incunabulum.net
Thu Nov 13 03:52:02 PST 2008


[Resending from correct alias to make sure this is archived]

ÑîС˧ wrote:
> Hello,
>
> If the libxorp/popen.cc code is derived from the FreeBSD popen(3)
> implementation, I think that the "setpgid(0, 0)" in the line 382 of
> popen.cc should not be existed.
>   

popen2() is normally used to run operational mode commands.

The use of setpgid(0,0) is to ensure child processes run with popen2()
are run in their own new process group, and that they are detached from
the controlling terminal.

The POSIX setsid() call might be more appropriate, however setpgid() is
slightly more widely available.

thanks
BMS



More information about the Xorp-hackers mailing list