diff options
| author | Garrett Wollman <wollman@FreeBSD.org> | 1995-04-13 18:04:11 +0000 |
|---|---|---|
| committer | Garrett Wollman <wollman@FreeBSD.org> | 1995-04-13 18:04:11 +0000 |
| commit | 3688be0eeb59367d9dd33e4b0963813b72ce0ef3 (patch) | |
| tree | fbf6927f1eb28df85e2a0dd7f66f9d426763b114 /lib/libc/gen/err.3 | |
| parent | ef46188e270769214feec340f295d49173a1d40d (diff) | |
Notes
Diffstat (limited to 'lib/libc/gen/err.3')
| -rw-r--r-- | lib/libc/gen/err.3 | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/libc/gen/err.3 b/lib/libc/gen/err.3 index 2a3f4c391fd38..a80edeb4c6077 100644 --- a/lib/libc/gen/err.3 +++ b/lib/libc/gen/err.3 @@ -29,9 +29,10 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)err.3 8.1 (Berkeley) 6/9/93 +.\" From: @(#)err.3 8.1 (Berkeley) 6/9/93 +.\" $Id$ .\" -.Dd "June 9, 1993" +.Dd April 13, 1995 .Dt ERR 3 .Os BSD 4 .Sh NAME @@ -42,7 +43,9 @@ .Nm warn , .Nm vwarn , .Nm warnx , -.Nm vwarnx +.Nm vwarnx , +.Nm err_set_file , +.Nm err_set_exit .Nd formatted error messages .Sh SYNOPSIS .Fd #include <err.h> @@ -62,13 +65,19 @@ .Fn warnx "const char *fmt" "..." .Ft void .Fn vwarnx "const char *fmt" "va_list args" +.Ft void +.Fn err_set_file "void *fp" +.Ft void +.Fn err_set_exit "void (*exitf)(int)" .Sh DESCRIPTION The .Fn err and .Fn warn family of functions display a formatted error message on the standard -error output. +error output, or on another file specified using the +.Fn err_set_file +function. In all cases, the last component of the program name, a colon character, and a space are output. If the @@ -95,6 +104,13 @@ and .Fn verrx functions do not return, but exit with the value of the argument .Fa eval . +The +.Fn err_set_exit +function can be used to specify a function which is called before +.Xr exit 2 +to perform any necessary cleanup; passing a null function pointer for +.Va exitf +resets the hook to do nothing. .Sh EXAMPLES Display the current errno information string and exit: .Bd -literal -offset indent |
