#include <eim.h> char * eimErr2String(EimRC * eimrc)Service Program Name: QSYS/QSYEIM
The eimErr2String() function converts the EIM return code structure returned by an EIM function into a NULL-terminated error message string. free() should be used to free the space allocated for the error message string.
No authorization is required.
If successful, the return value is the address of the error message. The caller is responsible for freeing the message.
If unsuccessful, eimErr2String returns a NULL pointer. The errno global variable is set to indicate the error. The errno may come from catopen, catget, or catclose or one of the following values.
The following example converts an EimRC into an error message and prints it.
Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.
#include <eim.h> #include <stdio.h> #include <errno.h> int main(int argc, char *argv[]) { int rc; EimRC * err; char * errMessage; /* Get EimRC from input arg. */ err = (EimRC *)argv[1]; /* Get error message */ if (NULL == (errMessage = eimErr2String(err))) { printf("eimErr2String error = %s", strerror(errno)); return -1; } /* Print the message */ printf("%s", errMessage); free(errMessage); return 0; }
[ Back to top | Security APIs | APIs by category ]