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 $
27 .\" $DragonFly: src/lib/libc/gen/fmtmsg.3,v 1.1 2008/10/06 21:01:37 swildner Exp $
34 .Nd display a detailed diagnostic message
41 .Fa "long classification" "const char *label" "int severity"
42 .Fa "const char *text" "const char *action" "const char *tag"
47 function displays a detailed diagnostic message, based on
48 the supplied arguments, to
50 and/or the system console.
54 argument is the bitwise inclusive
56 of zero or one of the manifest constants from
57 each of the classification groups below.
58 The Output classification group is an exception since both
63 .Bl -tag -width indent
65 .Bl -tag -width ".Dv MM_CONSOLE"
67 Output should take place on
70 Output should take place on the system console.
72 .It "Source of Condition (Major)"
73 .Bl -tag -width ".Dv MM_CONSOLE"
75 The source of the condition is hardware related.
77 The source of the condition is software related.
79 The source of the condition is firmware related.
81 .It "Source of Condition (Minor)"
82 .Bl -tag -width ".Dv MM_CONSOLE"
84 The condition was detected at the application level.
86 The condition was detected at the utility level.
88 The condition was detected at the operating system level.
91 .Bl -tag -width ".Dv MM_CONSOLE"
93 The application can recover from the condition.
95 The application is unable to recover from the condition.
101 manifest constant may be used to specify no classification.
105 argument indicates the source of the message.
106 It is made up of two fields separated by a colon
108 The first field can be up to 10 bytes,
109 and the second field can be up to 14 bytes.
112 manifest constant may be used to specify no label.
116 argument identifies the importance of the condition.
117 One of the following manifest constants should be used for this argument.
118 .Bl -tag -offset indent -width ".Dv MM_WARNING"
120 The application has confronted a serious fault and is halting.
122 The application has detected a fault.
124 The application has detected an unusual condition,
125 that could be indicative of a problem.
127 The application is providing information about a non-error condition.
129 No severity level supplied.
134 argument details the error condition that caused the message.
135 There is no limit on the size of this character string.
138 manifest constant may be used to specify no text.
142 argument details how the error-recovery process should begin.
147 to the beginning of the
152 manifest constant may be used to specify no action.
156 argument should reference online documentation for the message.
157 This usually includes the
159 and a unique identifying number.
164 manifest constant may be used to specify no tag.
172 to indicate output to
176 to indicate output to the system console failed, or
178 to indicate output to
180 and the system console failed.
185 environment variable specifies which arguments to
193 separated list of identifiers.
194 Valid identifiers include:
195 .Li label , severity , text , action ,
198 If invalid identifiers are specified or incorrectly separated,
199 the default message verbosity and ordering will be used.
200 The default ordering is equivalent to a
203 .Qq Li label:severity:text:action:tag .
206 .Bd -literal -offset indent
207 fmtmsg(MM_UTIL | MM_PRINT, "BSD:ls", MM_ERROR,
208 "illegal option -- z", "refer to manual", "BSD:ls:001");
212 .Bd -literal -offset indent
213 BSD:ls: ERROR: illegal option -- z
214 TO FIX: refer to manual BSD:ls:001
223 .Qq Li "text:severity:action:tag" ,
225 .Bd -literal -offset indent
226 illegal option -- z: ERROR
227 TO FIX: refer to manual BSD:ls:001
241 function first appeared in
250 argument makes little sense, since without an output specified,
252 is unable to do anything useful.
256 to output to the system console, the effective
257 user must have appropriate permission to write to
259 This means that on most systems
263 unless the effective user is root.