#include <assert.h>
#include <errno.h>
#include <string.h>
Go to the source code of this file.
|
int | strerror_r (int err_no, char *buffer, size_t buffer_size) |
|
◆ strerror_r()
int strerror_r |
( |
int |
err_no, |
|
|
char * |
buffer, |
|
|
size_t |
buffer_size |
|
) |
| |
Definition at line 5 of file strerror_r.c.
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.
References assert, ERANGE, memcpy(), strerror(), and strlen().