nginx/src/os/unix/ngx_errno.c

29 lines
393 B
C
Raw Normal View History

2003-12-15 04:10:27 +08:00
#include <ngx_config.h>
#include <ngx_core.h>
2003-12-15 21:57:13 +08:00
#if (HAVE_STRERROR_R)
2003-12-15 04:10:27 +08:00
ngx_int_t ngx_strerror_r(int err, char *errstr, size_t size)
{
size_t len;
if (size == 0) {
return 0;
}
errstr[0] = '\0';
strerror_r(err, errstr, size);
for (len = 0; len < size; len++) {
if (errstr[len] == '\0') {
break;
}
}
return len;
}
2003-12-15 21:57:13 +08:00
#endif