杨小帅 <[EMAIL PROTECTED]> 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

_______________________________________________
Xorp-hackers mailing list
[email protected]
http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers

Reply via email to