[Xorp-hackers] About op command!

杨小帅 eshe168 at gmail.com
Wed Nov 12 00:04:30 PST 2008


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.

Thanks,
Xiaoshuai Yang


2008/11/12 Pavlin Radoslavov <pavlin at icsi.berkeley.edu>:
> 杨小帅 <eshe168 at gmail.com> wrote:
>
>> Hi,
>>
>>      When I studied the popen.cc, there is a question to me. Why using
>> _exit(127) in the line 390, and what's mean the 127. I always see
>> _exit(0) after exec function.
>
> The libxorp/popen.cc code is derived from the FreeBSD popen(3)
> implementation. The _exit(127) statement actually comes from the
> original FreeBSD code. The following text from the popen(3) manual
> page suggests the purpose of 127:
>
> =====
> Failure to execute the shell is indistinguishable from the shell's fail-
> ure to execute command, or an immediate exit of the command.  The only
> hint is an exit status of 127.
> =====
>
> Hope that helps,
> Pavlin
>



More information about the Xorp-hackers mailing list