Submits a request to print an internationalized message to a process' controlling terminal.
#include <sys/uprintf.h>
int NLuprintf (Uprintf)
struct uprintf *Uprintf;
Item | Description |
---|---|
Uprintf | Points to a uprintf request structure. |
The NLuprintf kernel service submits a internationalized kernel message request with the uprintf request structure specified by the Uprintf parameter as input. Once the request has been successfully submitted, the uprintfd daemon retrieves, converts, formats, and writes the message described by the uprintf request structure to a process' controlling terminal.
The caller must initialize the uprintf request structure before calling the NLuprintf kernel service. Fields in the uprintf request structure use several constants. The following constants are defined in the /usr/include/sys/uprintf.h file:
The uprintf request structure consists of the following fields:
Field | Description |
---|---|
Uprintf->upf_defmsg | Points to a default message format. The default message format
is a character string that contains either or both of two types
of objects:
Each conversion specification consists of a % (percent sign) followed by a character that indicates the type of conversion to be applied:
Field-width or precision conversion specifications are not supported. The maximum length of the default message-format string pointed to by the Uprintf->upf_defmsg field is the number of characters specified by the UP_MAXSTR constant. The Uprintf->upf_defmsg field must be a nonnull character. The default message format is used in constructing the kernel message if the message format described by the Uprintf->upf_NLsetno and Uprint->upf_NLmsgno fields cannot be retrieved from the message catalog specified by Uprintf->upf_NLcatname. The conversion specifications contained within the default message format should match those contained in the message format specified by the upf_NLsetno and upf_NLmsgno fields. |
Uprintf->upf_arg[UP_MAXARGS] | Specifies from zero to the number of value parameters specified by the UP_MAXARGS constant. A Value parameter may be a integer value, a character value, or a string value (character pointer). Strings are limited in length to the number of characters specified by the UP_MAXSTR constant. String value parameters must be nonnull characters. The number, type, and order of items in the Value parameter array should match the conversion specifications within the message format string. |
Uprintf->upf_NLcatname | Points to the message catalog file name. If the catalog file name referred to by the Uprintf->upf_NLcatname field begins with a / (slash), it is assumed to be an absolute path name. If the catalog file name is not an absolute path name, the process environment determines the directory paths to search. The maximum length of the catalog file name is limited to the number of characters specified by the UP_MAXCAT constant. The value of the Uprintf->upf_NLcatname field must be a nonnull character. |
Uprintf->upf_NLsetno | Specifies the set ID. |
Uprintf->upf_NLmsgno | Specifies the message ID. The Uprintf->upf_NLsetno and
Uprintf->upf_NLmsgno fields specify a particular message
format string to be retrieved from the message catalog specified
by the Uprintf->upf_NLcatname field. The maximum length of the constructed kernel message is limited to the number of characters specified by the UP_MAXMSG constant. Messages larger then the number of characters specified by the UP_MAXMSG constant are discarded. |
The NLuprintf kernel service can be called from the process environment only.
Item | Description |
---|---|
0 | Indicates a successful operation. |
ENOMEM | Indicates that memory is not available to buffer the request. |
ENODEV | Indicates that a controlling terminal does not exist for the process. |
ESRCH | Indicates the uprintfd daemon is not active. No requests may be submitted. |
EINVAL | Indicates that the message catalog file-name pointer is null or the catalog file name is greater than the number of characters specified by the UP_MAXCAT constant. |
EINVAL | Indicates that a string-value parameter pointer is null or the string-value parameter is greater than the number of characters specified by the UP_MAXCAT constant. |
EINVAL | Indicates one of the following:
|