sysexits: Tidy deprecated header and manual

<sysexits.h> was deprecated in the base system in a1432b4 for FreeBSD
8.0 and is retained only for backwards compatibility.  Make that clear,
since sysexits(3) suggested using it since it was in style(9) prior
to this.

MFC after:	1 week
Co-authored-by:	imp
Fixes:		a1432b4
Reviewed by:	imp, pauamma (previous version)
Pull Request	https://github.com/freebsd/freebsd-src/pull/1195
This commit is contained in:
Alexander Ziaee 2024-05-09 20:43:39 -06:00 committed by Warner Losh
parent 9f91b8aaf5
commit 5ccaab1797
2 changed files with 22 additions and 28 deletions

View file

@ -35,9 +35,10 @@
/* /*
* SYSEXITS.H -- Exit status codes for system programs. * SYSEXITS.H -- Exit status codes for system programs.
* *
* This include file attempts to categorize possible error * This include file attempts to categorize error exit statuses
* exit statuses for system programs, notably delivermail * for system programs, notably sendmail. These values exist only
* and the Berkeley network. * for interface compatibility, and are deprecated for FreeBSD
* base software.
* *
* Error numbers begin at EX__BASE to reduce the possibility of * Error numbers begin at EX__BASE to reduce the possibility of
* clashing with other exit statuses that random programs may * clashing with other exit statuses that random programs may

View file

@ -1,7 +1,7 @@
.\"-
.\" SPDX-License-Identifier: BSD-2-Clause
.\" .\"
.\" Copyright (c) 1996 Joerg Wunsch .\" Copyright (c) 1996 Joerg Wunsch. All rights reserved.
.\"
.\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions
@ -23,27 +23,20 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" .\"
.\" " .Dd May 9, 2024
.Dd January 21, 2010
.Dt SYSEXITS 3 .Dt SYSEXITS 3
.Os .Os
.Sh NAME .Sh NAME
.Nm sysexits .Nm sysexits
.Nd preferable exit codes for programs .Nd legacy exit status codes for system programs
.Sh SYNOPSIS .Sh SYNOPSIS
.In sysexits.h .In sysexits.h
.Sh DESCRIPTION .Sh DESCRIPTION
According to Some commands attempt to describe the nature of a failure condition
.Xr style 9 , by using these pre-defined exit codes.
it is not a good practice to call This interface has been deprecated and is retained only for compatibility.
.Xr exit 3 Its use is discouraged.
with arbitrary values to indicate a failure condition when ending .Sh ERRORS
a program.
Instead, the pre-defined exit codes from
.Nm
should be used, so the caller of the process can get a rough
estimation about the failure class without looking up the source code.
.Pp
The successful exit is always indicated by a status of 0, or The successful exit is always indicated by a status of 0, or
.Sy EX_OK . .Sy EX_OK .
Error numbers begin at Error numbers begin at
@ -112,8 +105,7 @@ The remote system returned something that was
during a protocol exchange. during a protocol exchange.
.It Sy EX_NOPERM Pq 77 .It Sy EX_NOPERM Pq 77
You did not have sufficient permission to perform the operation. You did not have sufficient permission to perform the operation.
This This is not intended for file system problems, which should use
is not intended for file system problems, which should use
.Sy EX_NOINPUT .Sy EX_NOINPUT
or or
.Sy EX_CANTCREAT , .Sy EX_CANTCREAT ,
@ -131,12 +123,13 @@ parenthesis for easy reference.
.Sh HISTORY .Sh HISTORY
The The
.Nm .Nm
file appeared somewhere after file first appeared in
.Bx 4.3 . .Bx 4 .
.Sh AUTHORS .Sh AUTHORS
This manual page was written by This manual page was written by
.An J\(:org Wunsch .An J\(:org Wunsch .
after the comments in
.In sysexits.h .
.Sh BUGS .Sh BUGS
The choice of an appropriate exit value is often ambiguous. .Bl -tag -width 0 -compact
.It This interface is not portable.
.It The choice of an appropriate exit value is often ambiguous.
.El