|
NAMEfmtmsg —
display a detailed diagnostic message
LIBRARYStandard C Library (libc, -lc)SYNOPSIS#include <fmtmsg.h>
int
DESCRIPTIONThefmtmsg () function displays a detailed diagnostic
message, based on the supplied arguments, to stderr
and/or the system console.
The classification argument is the bitwise
inclusive OR of zero or one of the manifest constants from each of the
classification groups below. The Output classification group is an exception
since both
Alternatively, the The label argument indicates the source of
the message. It is made up of two fields separated by a colon
(‘ The severity argument identifies the importance of the condition. One of the following manifest constants should be used for this argument.
The text argument details the error
condition that caused the message. There is no limit on the size of this
character string. The The action argument details how the
error-recovery process should begin. Upon output,
The tag argument should reference online
documentation for the message. This usually includes the
label and a unique identifying number. An example tag
is “ RETURN VALUESThefmtmsg () function returns
MM_OK upon success, MM_NOMSG
to indicate output to stderr failed,
MM_NOCON to indicate output to the system console
failed, or MM_NOTOK to indicate output to
stderr and the system console failed.
ENVIRONMENTTheMSGVERB (message verbosity) environment variable
specifies which arguments to fmtmsg () will be output
to stderr , and in which order.
MSGVERB should be a colon
(‘: ’) separated list of identifiers.
Valid identifiers include: label ,
severity , text ,
action , and tag . If invalid
identifiers are specified or incorrectly separated, the default message
verbosity and ordering will be used. The default ordering is equivalent to a
MSGVERB with a value of
“label:severity:text:action:tag ”.
EXAMPLESThe code:fmtmsg(MM_UTIL | MM_PRINT, "BSD:ls", MM_ERROR, "illegal option -- z", "refer to manual", "BSD:ls:001"); will output: BSD:ls: ERROR: illegal option -- z TO FIX: refer to manual BSD:ls:001 to The same code, with illegal option -- z: ERROR TO FIX: refer to manual BSD:ls:001 SEE ALSOerr(3), exit(3), strerror(3)STANDARDSThefmtmsg () function conforms to IEEE
Std 1003.1-2001 (“POSIX.1”).
HISTORYThefmtmsg () function first appeared in
FreeBSD 5.0.
BUGSSpecifyingMM_NULLMC for the
classification argument makes little sense, since
without an output specified, fmtmsg () is unable to do
anything useful.
In order for
Visit the GSP FreeBSD Man Page Interface. |