next up previous contents [pdf] index

Next: Call Up: Handling warning and error Previous: Handling warning and error


Outputs an error message to stderr, which is usually the screen. It uses sf_getprog to get the name of the program which is causing the error and print it on the screen. Uses vfprintf, which can take a variable number of arguments initialized by va_list. This gives the user flexibility in choosing the number of arguments.

If there is a ':' at the end of format, information about the system errors is printed, this is done by using strerror to interpret the last error number errno in the system. Also, if there is a ';' at the end of a format the command prompt will not go to the next line.