diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-12-14 23:10:27 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-12-14 23:10:27 +0300 |
commit | dc867cd0fed793f86ce2b460f8c2ad069ddec1b5 (patch) | |
tree | 507db64a0a152c9ec99785a3ea887154ec4873b3 /src/os/unix/ngx_errno.c | |
parent | 2b58fbf045acee349c323de8f50501f94c41c04d (diff) |
nginx-0.0.1-2003-12-14-23:10:27 import
Diffstat (limited to 'src/os/unix/ngx_errno.c')
-rw-r--r-- | src/os/unix/ngx_errno.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/os/unix/ngx_errno.c b/src/os/unix/ngx_errno.c new file mode 100644 index 000000000..e94f2c9b0 --- /dev/null +++ b/src/os/unix/ngx_errno.c @@ -0,0 +1,24 @@ +#include <ngx_config.h> +#include <ngx_core.h> + + +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; +} |