2 .\" Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" $FreeBSD: src/lib/libc/gen/fmtmsg.3,v 1.4 2002/12/04 18:57:44 ru Exp $
33 .Nd display a detailed diagnostic message
40 .Fa "long classification" "const char *label" "int severity"
41 .Fa "const char *text" "const char *action" "const char *tag"
46 function displays a detailed diagnostic message, based on
47 the supplied arguments, to
49 and/or the system console.
53 argument is the bitwise inclusive
55 of zero or one of the manifest constants from
56 each of the classification groups below.
57 The Output classification group is an exception since both
62 .Bl -tag -width indent
64 .Bl -tag -width ".Dv MM_CONSOLE"
66 Output should take place on
69 Output should take place on the system console.
71 .It "Source of Condition (Major)"
72 .Bl -tag -width ".Dv MM_CONSOLE"
74 The source of the condition is hardware related.
76 The source of the condition is software related.
78 The source of the condition is firmware related.
80 .It "Source of Condition (Minor)"
81 .Bl -tag -width ".Dv MM_CONSOLE"
83 The condition was detected at the application level.
85 The condition was detected at the utility level.
87 The condition was detected at the operating system level.
90 .Bl -tag -width ".Dv MM_CONSOLE"
92 The application can recover from the condition.
94 The application is unable to recover from the condition.
100 manifest constant may be used to specify no classification.
104 argument indicates the source of the message.
105 It is made up of two fields separated by a colon
107 The first field can be up to 10 bytes,
108 and the second field can be up to 14 bytes.
111 manifest constant may be used to specify no label.
115 argument identifies the importance of the condition.
116 One of the following manifest constants should be used for this argument.
117 .Bl -tag -offset indent -width ".Dv MM_WARNING"
119 The application has confronted a serious fault and is halting.
121 The application has detected a fault.
123 The application has detected an unusual condition,
124 that could be indicative of a problem.
126 The application is providing information about a non-error condition.
128 No severity level supplied.
133 argument details the error condition that caused the message.
134 There is no limit on the size of this character string.
137 manifest constant may be used to specify no text.
141 argument details how the error-recovery process should begin.
146 to the beginning of the
151 manifest constant may be used to specify no action.
155 argument should reference online documentation for the message.
156 This usually includes the
158 and a unique identifying number.
163 manifest constant may be used to specify no tag.
171 to indicate output to
175 to indicate output to the system console failed, or
177 to indicate output to
179 and the system console failed.
184 environment variable specifies which arguments to
192 separated list of identifiers.
193 Valid identifiers include:
194 .Li label , severity , text , action ,
197 If invalid identifiers are specified or incorrectly separated,
198 the default message verbosity and ordering will be used.
199 The default ordering is equivalent to a
202 .Qq Li label:severity:text:action:tag .
205 .Bd -literal -offset indent
206 fmtmsg(MM_UTIL | MM_PRINT, "BSD:ls", MM_ERROR,
207 "illegal option -- z", "refer to manual", "BSD:ls:001");
211 .Bd -literal -offset indent
212 BSD:ls: ERROR: illegal option -- z
213 TO FIX: refer to manual BSD:ls:001
222 .Qq Li "text:severity:action:tag" ,
224 .Bd -literal -offset indent
225 illegal option -- z: ERROR
226 TO FIX: refer to manual BSD:ls:001
240 function first appeared in
247 argument makes little sense, since without an output specified,
249 is unable to do anything useful.
253 to output to the system console, the effective
254 user must have appropriate permission to write to
256 This means that on most systems
260 unless the effective user is root.