Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Oct 2001 23:14:28 +0100 (CET)
From:      Oliver Fromme <olli@secnetix.de>
To:        freebsd-stable@FreeBSD.ORG
Subject:   Re: pathname length over NFS
Message-ID:  <200110282214.f9SMESs99232@lurza.secnetix.de>
In-Reply-To: <4.2.2.20011028145225.00a64470@mailhost.dcfinc.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Chad R. Larson <chad@dcfinc.com> wrote:
 > Why is there an overlap 
 > between the recommended codes in sysexits(3) and "/usr/include/errno.h"?

They serve different purposes, and are used for different
things, so there shouldn't be a conflict.

The errno values are used as return values from syscalls
and library functions.  They are _not_ used for program
exit codes.  Unfortunately, some programs print numerical
errno values because they're too stupid (or too lazy) to
use perror() or strerror() or some similar way to display
a readable error string.  Normally, the user should not
need to care about errno numbers at all.  They are for
programmers.

The sysexits(3) values were originally intended as a way
to communicate between programs:  When sendmail calls an
external program (e.g. mail_local or procmail), it checks
the exit code to find out if everything is alright, or if
a transient problem occured, or if something went out of
resources, or if a fatal error occured.  Depending on that,
sendmail deletes the mail, or spools it locally for another
delivery attempt at a later time, or bounces it back with
an appropriate error message.  Other, non mail-related
tools use sysexits(3) values, too, to further classify
the result beyond the traditional 0/ok and 1/failure, so
that scripts and other programs have a better chance to do
sensible things when something went wrong.  This is a good
thing, IMO.

Regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"All that we see or seem is just a dream within a dream" (E. A. Poe)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110282214.f9SMESs99232>