Function rcutils_strerror

Function Documentation

void rcutils_strerror(char *buffer, size_t buffer_length)

Retrieve the string corresponding to the last system error.

This function retrieves the value of errno, and calls the system-specific equivalent of strerror on it, storing the output in the provided buffer. If the error message is longer than the buffer, it will be truncated. The memory for the c-string buffer that is passed in must be managed by the caller.

This function is thread-safe.

Parameters:
  • buffer[inout] The buffer in which to store the data

  • buffer_length[in] the maximum length of the buffer