wpar_log_err Subroutine
Purpose
Logs an error message for a specific WPAR.
Library
libwparlog.a
Syntax
#include <wpars/wparlog.h>
int wpar_log_err(
kcid, cat_file_name,
msg_set_no, msg_no,
default_fmt_msg, ...)
cid_t kcid;
char * cat_file_name;
unsigned int msg_set_no;
unsigned int msg_no;
char * default_fmt_msg;
kcid, cat_file_name,
msg_set_no, msg_no,
default_fmt_msg, ...)
cid_t kcid;
char * cat_file_name;
unsigned int msg_set_no;
unsigned int msg_no;
char * default_fmt_msg;
Description
The wpar_log_err interface provides a mechanism to log error messages for a given WPAR. Each WPAR can hold up to 1 KB of error message. If there is enough space to log the new message, the command logs the message otherwise it fails. When called from a process inside the WPAR, the kcid parameter should match the CID of that WPAR. Otherwise the routine will report failure.
Parameters
Item | Description |
---|---|
kcid | CID of the WPAR. The CID can be obtained from the WPAR name using the getcorralid and corral_getcid system calls. |
cat_file_name | Catalog file name to be used for translation |
msg_set_no | Message sets the number of the error messages in the catalog file |
msg_no | Message number of the error message |
default_fmt_msg | <Need description> |
… | Arguments to the message if any |
Return Values
Item | Description |
---|---|
0 | Successful completion |
-1 | Failure |
Error codes
Item | Description |
---|---|
ENOMEM | Not enough memory |
EPERM | No permission to log message into the specified WPAR |
EINVAL | Invalid parameter |
Example
/*Log a error message into WPAR with cid 4.*/
…
wpar_log_err(4, “wparerrs.cat”,1,10,”%s : command failed”, “mycommand”);
…