pfmt(3C)pfmt(3C)NAMEpfmt(), vpfmt() - display message in standard format
SYNOPSISDESCRIPTION
The system call can be used to write a message in standard format to
stream. It can also be used to write a localized string to stream.
The arguments to are formatted using style formatting. is similar to
except that the arguments are passed in an argument list (see
stdarg(5)).
The standard format displayed on stream has the following fields:
The label string is defined through setlabel(3C). If no label is
defined, this field is not used. The severity string is controlled by
the severity group of flags. The text string is the formatted user
string.
The flags control how formatting is done. The control information is
separated into several different groups. Only one flag from each group
should be set.
Output Format
Do not use the standard format.
Treat fmt as a format string. In
this mode, only flags related to cat‐
alog access can be set.
Format using the standard format
is the default).
Catalog Access
Do not access the localized message catalog.
Use the def_str (a field in fmt) as
the format string.
Access the localized message catalog
is the default).
Severity
Display a localized string.
Display a localized string is the default).
Display a localized string.
Display a localized string.
Besides these reserved severities, additional severity
strings may be defined by the user (see addsev(3C)). To
specify a user defined severity, flags should be a logi‐
cal-or of the numeric value of the user defined severity
and flags from other control groups.
Action
This flag generates the localized string of
in the severity field of the standard
format message. If this flag and
flags from the severity control group
are set, this flag has precedence and
the string will be displayed.
The fmt string has the following fields:
The catalog is the message catalog created by mkmsgs(1) where the
localized message is to be retrieved. The msg_number is a positive
index number identifying the string to be retrieved from the message
catalog (begins at 1). The def_str is the default string to use if
fails to retrieve the message from catalog from either the current
locale or the default locale. The failure may occur if the message
catalog does not exist or if the msg_number is out of bound.
If catalog is not specified, uses the message catalog defined by set‐
cat(3C). If is set in flags, only def_str must be specified.
The system call displays under the following conditions:
· No message catalog is specified in fmt and no catalog is defined
via setcat(3C).
· msg_number is not positive.
· No message could be retrieved and def_str is not specified.
RETURN VALUE
If successful, and return the number of bytes written. Otherwise, they
return a negative value.
EXAMPLES
Example 1
generates the message:
Example 2
generates the message:
Example 3
generates the message:
Example 4
generates the message:
SEE ALSOmkmsgs(1), addsev(3C), gettxt(3C), printf(3S), setcat(3C), setla‐
bel(3C), setlocale(3C), stdarg(5), thread_safety(5).
STANDARDS CONFORMANCEpfmt(3C)