The system_errmsg function returns the last error that occurred from the most recent system call. This function is implemented as a macro that returns an entry from the global array sys_errlist. Use this macro to help with I/O error diagnostics.
char *system_errmsg(int param1);
A string containing the text of the latest error message that resulted from a system call. Do not FREE this string.
int param1 is reserved, and should always have the value 0.