5 int strerror_r(
int err_no,
char* buffer,
size_t buffer_size)
9 size_t length =
strlen(err_msg);
13 if(length >= buffer_size)
18 memcpy(buffer, err_msg, buffer_size - 1);
20 buffer[buffer_size - 1] = 0;
28 memcpy(buffer, err_msg, length + 1);
size_t strlen(const char *str)
Returns the length of the given null-terminated byte string.
void * memcpy(void *__restrict dest, const void *__restrict src, size_t n)
Copies n characters from the object pointed to by src to the object pointed to by dest.
int strerror_r(int err_no, char *buffer, size_t buffer_size)