Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/gen/err.3
Show All 22 Lines | |||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" From: @(#)err.3 8.1 (Berkeley) 6/9/93 | .\" From: @(#)err.3 8.1 (Berkeley) 6/9/93 | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd March 29, 2012 | .Dd May 5, 2014 | ||||
wblock: This should be the date this was changed/added in FreeBSD, unless there is something I've… | |||||
.Dt ERR 3 | .Dt ERR 3 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm err , | .Nm err , | ||||
.Nm verr , | .Nm verr , | ||||
.Nm errc , | .Nm errc , | ||||
.Nm verrc , | .Nm verrc , | ||||
.Nm errx , | .Nm errx , | ||||
.Nm verrx , | .Nm verrx , | ||||
.Nm warn , | .Nm warn , | ||||
.Nm vwarn , | .Nm vwarn , | ||||
.Nm warnc , | .Nm warnc , | ||||
.Nm vwarnc , | .Nm vwarnc , | ||||
.Nm warnx , | .Nm warnx , | ||||
.Nm vwarnx , | .Nm vwarnx , | ||||
.Nm err_set_exit , | .Nm err_set_exit , | ||||
.Nm err_set_exit_b , | |||||
.Nm err_set_file | .Nm err_set_file | ||||
.Nd formatted error messages | .Nd formatted error messages | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libc | .Lb libc | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In err.h | .In err.h | ||||
.Ft void | .Ft void | ||||
.Fn err "int eval" "const char *fmt" "..." | .Fn err "int eval" "const char *fmt" "..." | ||||
.Ft void | .Ft void | ||||
.Fn err_set_exit "void (*exitf)(int)" | .Fn err_set_exit "void (*exitfunc)(int)" | ||||
.Ft void | .Ft void | ||||
.Fn err_set_exit_b "void (^exitblock)(int)" | |||||
.Ft void | |||||
.Fn err_set_file "void *vfp" | .Fn err_set_file "void *vfp" | ||||
.Ft void | .Ft void | ||||
.Fn errc "int eval" "int code" "const char *fmt" "..." | .Fn errc "int eval" "int code" "const char *fmt" "..." | ||||
.Ft void | .Ft void | ||||
.Fn errx "int eval" "const char *fmt" "..." | .Fn errx "int eval" "const char *fmt" "..." | ||||
.Ft void | .Ft void | ||||
.Fn warn "const char *fmt" "..." | .Fn warn "const char *fmt" "..." | ||||
.Ft void | .Ft void | ||||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | |||||
It is recommended that the standard values defined in | It is recommended that the standard values defined in | ||||
.Xr sysexits 3 | .Xr sysexits 3 | ||||
be used for the value of | be used for the value of | ||||
.Fa eval . | .Fa eval . | ||||
The | The | ||||
.Fn err_set_exit | .Fn err_set_exit | ||||
function can be used to specify a function which is called before | function can be used to specify a function which is called before | ||||
.Xr exit 3 | .Xr exit 3 | ||||
to perform any necessary cleanup; passing a null function pointer for | to perform any necessary cleanup; passing a null function pointer for | ||||
Not Done Inline ActionsBetter to just split the sentence in two: to perform any necessary cleanup. wblock: Better to just split the sentence in two:
to perform any necessary cleanup.
Passing a null… | |||||
.Va exitf | .Va exitfunc | ||||
resets the hook to do nothing. | resets the hook to do nothing. | ||||
The | The | ||||
.Fn err_set_exit_b | |||||
function is like | |||||
Not Done Inline ActionsThis should use the function markup, should probably have a comma after the function name for a pause: function is like wblock: This should use the function markup, should probably have a comma after the function name for a… | |||||
.Fn err_set_exit , | |||||
except it takes the block pointer, | |||||
Not Done Inline ActionsPlease start new sentences on new lines: instead of a function pointer. wblock: Please start new sentences on new lines:
instead of a function pointer.
Note that the | |||||
.Va exitblock , | |||||
instead of a function pointer. | |||||
Note that the | |||||
.Fn Block_copy | |||||
function is used by | |||||
.Fn err_set_exit_b | |||||
to make a copy in case the block is freed or goes out of scope. | |||||
The | |||||
.Fn err_set_file | .Fn err_set_file | ||||
function sets the output stream used by the other functions. | function sets the output stream used by the other functions. | ||||
Its | Its | ||||
.Fa vfp | .Fa vfp | ||||
argument must be either a pointer to an open stream | argument must be either a pointer to an open stream | ||||
(possibly already converted to void *) | (possibly already converted to void *) | ||||
or a null pointer | or a null pointer | ||||
(in which case the output stream is set to standard error). | (in which case the output stream is set to standard error). | ||||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | |||||
functions first appeared in | functions first appeared in | ||||
.Fx 2.1 . | .Fx 2.1 . | ||||
The | The | ||||
.Fn errc | .Fn errc | ||||
and | and | ||||
.Fn warnc | .Fn warnc | ||||
functions first appeared in | functions first appeared in | ||||
.Fx 3.0 . | .Fx 3.0 . | ||||
The | |||||
.Fn err_set_exit_b | |||||
function first appeared in Mac OS X. This implementation was | |||||
created by Stacey Son for | |||||
.Fx 11.0 . |
This should be the date this was changed/added in FreeBSD, unless there is something I've missed. Likewise in the other changed or added man pages.