|
KallistiOS git master
Independent SDK for the Sega Dreamcast
|
Errno helper functions. More...
#include <errno.h>Go to the source code of this file.
Macros | |
| #define | errno_save_scoped() |
| Save the current 'errno' value until the block exit. | |
| #define | errno_if_nonzero(x) |
| Return errno if the value is non-zero, otherwise return zero. | |
Errno helper functions.
This file contains functions and macros related to the 'errno' variable.
| #define errno_if_nonzero | ( | x | ) |
Return errno if the value is non-zero, otherwise return zero.
This simple macro can be used to interface the functions that return 0 on success and -1 on error, with the actual error code stored in the errno variable.
| x | The integer value to process |
| #define errno_save_scoped | ( | ) |
Save the current 'errno' value until the block exit.
This macro will keep a copy of the current value of the errno variable, and will restore it once the execution exits the functional block in which the macro was called.