riot_sys

Function tiny_strerror

Source
pub unsafe extern "C" fn tiny_strerror(errnum: c_int) -> *const c_char
Expand description

@brief Get the name of an errno macro

@param[in] errnum Error code to get the name of

Example:

    puts(tiny_strerror(ENOENT)); // prints "ENOENT"
    puts(tiny_strerror(-ENXIO)); // prints "-ENXIO"
    puts(tiny_strerror(0)); // prints "OK"
    puts(tiny_strerror(1337)); // prints "unknown"
    puts(tiny_strerror(-1337)); // prints "-unknown"

@return String holding the macro name of the error given by @p errnum

@retval "OK" If @p errnum is 0 @retval "unknown" If @p errnum is not matching any POSIX errno constant @retval "-unknown" If @p errnum is negative not matching any negative POSIX errno constant