|Skip Navigation Links|
|Exit Print View|
|man pages section 3: Basic Library Functions Oracle Solaris 11 Information Library|
- define the label for pfmt() and lfmt()
#include <pfmt.h> int setlabel(const char *label);
The label argument is a character string no more than 25 characters in length.
No label is defined before setlabel() is called. The label should be set once at the beginning of a utility and remain constant. A null pointer or an empty string passed as argument will reset the definition of the label.
Upon successful completion, setlabel() returns 0; otherwise, it returns a non-zero value.
The following code (without previous call to setlabel()):
pfmt(stderr, MM_ERROR, "test:2:Cannot open file\n"); setlabel("UX:test"); pfmt(stderr, MM_ERROR, "test:2:Cannot open file\n");
will produce the following output:
ERROR: Cannot open file UX:test: ERROR: Cannot open file
See attributes(5) for descriptions of the following attributes: