err.3 (25bb73e063c17cd9048cf60100dbc0ac5177e94a) err.3 (b4183771fd8ab7a5946fd38df04c1e24b1268bea)
1.\" Copyright (c) 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 82 unchanged lines hidden (view full) ---

91.Fn warn
92family of functions display a formatted error message on the standard
93error output, or on another file specified using the
94.Fn err_set_file
95function.
96In all cases, the last component of the program name, a colon character,
97and a space are output.
98If the
1.\" Copyright (c) 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 82 unchanged lines hidden (view full) ---

91.Fn warn
92family of functions display a formatted error message on the standard
93error output, or on another file specified using the
94.Fn err_set_file
95function.
96In all cases, the last component of the program name, a colon character,
97and a space are output.
98If the
99.Va fmt
99.Fa fmt
100argument is not NULL, the formatted error message is output.
100argument is not NULL, the formatted error message is output.
101The output is terminated by a newline character.
102.Pp
103The
104.Fn err ,
105.Fn errc ,
106.Fn verr ,
107.Fn verrc ,
108.Fn warn ,
109.Fn warnc ,
110.Fn vwarn ,
111and
112.Fn vwarnc
113functions append an error message obtained from
114.Xr strerror 3
115based on a code or the global variable
116.Va errno ,
117preceeded by another colon and space unless the
118.Fa fmt
119argument is
120.Dv NULL .
121.Pp
101In the case of the
102.Fn errc ,
103.Fn verrc ,
104.Fn warnc ,
105and
106.Fn vwarnc
107functions,
122In the case of the
123.Fn errc ,
124.Fn verrc ,
125.Fn warnc ,
126and
127.Fn vwarnc
128functions,
108the error message string affiliated with the
109.Va code
110argument is also output,
111preceded by another colon and space if necessary.
112In all cases, the output is followed by a newline character.
129the
130.Fa code
131argument is used to look up the error message.
113.Pp
114The
115.Fn err ,
116.Fn verr ,
117.Fn warn ,
118and
119.Fn vwarn
120functions use the global variable
121.Va errno
132.Pp
133The
134.Fn err ,
135.Fn verr ,
136.Fn warn ,
137and
138.Fn vwarn
139functions use the global variable
140.Va errno
122rather than the
123.Va code
124argument of the
125.Fn errc
126family
141to look up the error message.
127.Pp
128The
142.Pp
143The
144.Fn errx
145and
146.Fn warnx
147functions do not append an error message.
148.Pp
149The
129.Fn err ,
130.Fn verr ,
131.Fn errc ,
132.Fn verrc ,
133.Fn errx ,
134and
135.Fn verrx
136functions do not return, but exit with the value of the argument

--- 4 unchanged lines hidden (view full) ---

141.Xr exit 3
142to perform any necessary cleanup; passing a null function pointer for
143.Va exitf
144resets the hook to do nothing.
145The
146.Fn err_set_file
147function sets the output stream used by the other functions.
148Its
150.Fn err ,
151.Fn verr ,
152.Fn errc ,
153.Fn verrc ,
154.Fn errx ,
155and
156.Fn verrx
157functions do not return, but exit with the value of the argument

--- 4 unchanged lines hidden (view full) ---

162.Xr exit 3
163to perform any necessary cleanup; passing a null function pointer for
164.Va exitf
165resets the hook to do nothing.
166The
167.Fn err_set_file
168function sets the output stream used by the other functions.
169Its
149.Va vfp
170.Fa vfp
150argument must be either a pointer to an open stream
151(possibly already converted to void *)
152or a null pointer
153(in which case the output stream is set to standard error).
154.Sh EXAMPLES
155Display the current errno information string and exit:
156.Bd -literal -offset indent
157if ((p = malloc(size)) == NULL)

--- 49 unchanged lines hidden ---
171argument must be either a pointer to an open stream
172(possibly already converted to void *)
173or a null pointer
174(in which case the output stream is set to standard error).
175.Sh EXAMPLES
176Display the current errno information string and exit:
177.Bd -literal -offset indent
178if ((p = malloc(size)) == NULL)

--- 49 unchanged lines hidden ---