[Xorp-hackers] About op command!

Pavlin Radoslavov pavlin at ICSI.Berkeley.EDU
Tue Nov 11 22:26:10 PST 2008


杨小帅 <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