2004-09-28 16:34:51 +08:00
|
|
|
|
|
|
|
/*
|
2004-09-30 00:00:49 +08:00
|
|
|
* Copyright (C) Igor Sysoev
|
2004-09-28 16:34:51 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2002-08-07 00:39:45 +08:00
|
|
|
#ifndef _NGX_ERRNO_H_INCLUDED_
|
|
|
|
#define _NGX_ERRNO_H_INCLUDED_
|
|
|
|
|
|
|
|
|
2004-02-11 00:23:38 +08:00
|
|
|
#include <ngx_config.h>
|
|
|
|
#include <ngx_core.h>
|
2002-08-07 00:39:45 +08:00
|
|
|
|
2003-06-03 23:42:58 +08:00
|
|
|
|
2002-08-07 00:39:45 +08:00
|
|
|
typedef int ngx_err_t;
|
|
|
|
|
|
|
|
#define NGX_ENOENT ENOENT
|
2004-04-20 15:00:43 +08:00
|
|
|
#define NGX_ESRCH ESRCH
|
2002-08-07 00:39:45 +08:00
|
|
|
#define NGX_EINTR EINTR
|
2003-12-26 04:26:58 +08:00
|
|
|
#define NGX_ECHILD ECHILD
|
2004-07-07 23:01:00 +08:00
|
|
|
#define NGX_ENOMEM ENOMEM
|
2003-01-15 15:02:27 +08:00
|
|
|
#define NGX_EACCES EACCES
|
2003-12-26 04:26:58 +08:00
|
|
|
#define NGX_EBUSY EBUSY
|
2003-05-23 19:53:01 +08:00
|
|
|
#define NGX_EEXIST EEXIST
|
2003-01-10 14:09:20 +08:00
|
|
|
#define NGX_ENOTDIR ENOTDIR
|
2004-07-07 23:01:00 +08:00
|
|
|
#define NGX_EINVAL EINVAL
|
2006-04-14 17:53:38 +08:00
|
|
|
#define NGX_ENOSPC ENOSPC
|
2003-12-26 04:26:58 +08:00
|
|
|
#define NGX_EPIPE EPIPE
|
2005-03-19 20:38:37 +08:00
|
|
|
#define NGX_EAGAIN EAGAIN
|
2002-12-03 00:09:40 +08:00
|
|
|
#define NGX_EINPROGRESS EINPROGRESS
|
2002-08-20 22:48:28 +08:00
|
|
|
#define NGX_EADDRINUSE EADDRINUSE
|
2004-02-03 05:19:52 +08:00
|
|
|
#define NGX_ECONNABORTED ECONNABORTED
|
2003-03-12 04:38:13 +08:00
|
|
|
#define NGX_ECONNRESET ECONNRESET
|
2004-01-06 04:55:48 +08:00
|
|
|
#define NGX_ENOTCONN ENOTCONN
|
2002-08-26 23:18:19 +08:00
|
|
|
#define NGX_ETIMEDOUT ETIMEDOUT
|
2004-03-15 04:46:25 +08:00
|
|
|
#define NGX_ECONNREFUSED ECONNREFUSED
|
2005-09-23 19:02:22 +08:00
|
|
|
#define NGX_ENAMETOOLONG ENAMETOOLONG
|
2004-03-15 04:46:25 +08:00
|
|
|
#define NGX_EHOSTUNREACH EHOSTUNREACH
|
2004-11-21 03:52:20 +08:00
|
|
|
#define NGX_ENOSYS ENOSYS
|
2003-02-07 01:21:13 +08:00
|
|
|
#define NGX_ECANCELED ECANCELED
|
2003-11-17 05:49:42 +08:00
|
|
|
#define NGX_ENOMOREFILES 0
|
|
|
|
|
2002-08-07 00:39:45 +08:00
|
|
|
|
2003-03-12 04:38:13 +08:00
|
|
|
|
2002-08-24 00:14:30 +08:00
|
|
|
#define ngx_errno errno
|
|
|
|
#define ngx_socket_errno errno
|
2003-11-17 05:49:42 +08:00
|
|
|
#define ngx_set_errno(err) errno = err
|
2002-08-24 00:14:30 +08:00
|
|
|
#define ngx_set_socket_errno(err) errno = err
|
2002-08-07 00:39:45 +08:00
|
|
|
|
2003-12-15 04:10:27 +08:00
|
|
|
|
2004-11-26 00:17:31 +08:00
|
|
|
#if (NGX_HAVE_STRERROR_R || NGX_HAVE_GNU_STRERROR_R)
|
2003-12-15 04:10:27 +08:00
|
|
|
|
2004-11-11 22:07:14 +08:00
|
|
|
u_char *ngx_strerror_r(int err, u_char *errstr, size_t size);
|
2003-12-15 04:10:27 +08:00
|
|
|
|
|
|
|
#else
|
2003-05-29 21:02:09 +08:00
|
|
|
|
2005-05-23 20:07:45 +08:00
|
|
|
/* Solaris and Tru64 UNIX have thread-safe strerror() */
|
2004-10-25 23:29:23 +08:00
|
|
|
|
2002-08-07 00:39:45 +08:00
|
|
|
#define ngx_strerror_r(err, errstr, size) \
|
2005-03-19 20:38:37 +08:00
|
|
|
ngx_cpystrn(errstr, (u_char *) strerror(err), size)
|
2002-08-07 00:39:45 +08:00
|
|
|
|
2003-12-15 04:10:27 +08:00
|
|
|
#endif
|
|
|
|
|
2002-08-07 00:39:45 +08:00
|
|
|
|
|
|
|
#endif /* _NGX_ERRNO_H_INCLUDED_ */
|