xref: /unit/src/nxt_errno.h (revision 2084:7d479274f334)
10Sigor@sysoev.ru 
20Sigor@sysoev.ru /*
30Sigor@sysoev.ru  * Copyright (C) Igor Sysoev
40Sigor@sysoev.ru  * Copyright (C) NGINX, Inc.
50Sigor@sysoev.ru  */
60Sigor@sysoev.ru 
70Sigor@sysoev.ru #ifndef _NXT_UNIX_ERRNO_H_INCLUDED_
80Sigor@sysoev.ru #define _NXT_UNIX_ERRNO_H_INCLUDED_
90Sigor@sysoev.ru 
100Sigor@sysoev.ru 
110Sigor@sysoev.ru typedef int                        nxt_err_t;
120Sigor@sysoev.ru 
130Sigor@sysoev.ru 
140Sigor@sysoev.ru #define NXT_EPERM                  EPERM
150Sigor@sysoev.ru #define NXT_ENOENT                 ENOENT
160Sigor@sysoev.ru #define NXT_ENOPATH                ENOENT
170Sigor@sysoev.ru #define NXT_ESRCH                  ESRCH
180Sigor@sysoev.ru #define NXT_EINTR                  EINTR
191200Svbart@nginx.com #define NXT_ENXIO                  ENXIO
200Sigor@sysoev.ru #define NXT_ECHILD                 ECHILD
210Sigor@sysoev.ru #define NXT_ENOMEM                 ENOMEM
220Sigor@sysoev.ru #define NXT_EACCES                 EACCES
230Sigor@sysoev.ru #define NXT_EBUSY                  EBUSY
240Sigor@sysoev.ru #define NXT_EEXIST                 EEXIST
251855Sz.hong@f5.com #define NXT_ELOOP                  ELOOP
260Sigor@sysoev.ru #define NXT_EXDEV                  EXDEV
270Sigor@sysoev.ru #define NXT_ENOTDIR                ENOTDIR
280Sigor@sysoev.ru #define NXT_EISDIR                 EISDIR
290Sigor@sysoev.ru #define NXT_EINVAL                 EINVAL
300Sigor@sysoev.ru #define NXT_ENOSPC                 ENOSPC
310Sigor@sysoev.ru #define NXT_EPIPE                  EPIPE
320Sigor@sysoev.ru #define NXT_EINPROGRESS            EINPROGRESS
330Sigor@sysoev.ru #define NXT_EOPNOTSUPP             EOPNOTSUPP
340Sigor@sysoev.ru #define NXT_EADDRINUSE             EADDRINUSE
350Sigor@sysoev.ru #define NXT_ECONNABORTED           ECONNABORTED
360Sigor@sysoev.ru #define NXT_ECONNRESET             ECONNRESET
370Sigor@sysoev.ru #define NXT_ENOTCONN               ENOTCONN
380Sigor@sysoev.ru #define NXT_ETIMEDOUT              ETIMEDOUT
390Sigor@sysoev.ru #define NXT_ECONNREFUSED           ECONNREFUSED
400Sigor@sysoev.ru #define NXT_ENAMETOOLONG           ENAMETOOLONG
410Sigor@sysoev.ru #define NXT_ENETDOWN               ENETDOWN
420Sigor@sysoev.ru #define NXT_ENETUNREACH            ENETUNREACH
430Sigor@sysoev.ru #define NXT_EHOSTDOWN              EHOSTDOWN
440Sigor@sysoev.ru #define NXT_EHOSTUNREACH           EHOSTUNREACH
450Sigor@sysoev.ru #define NXT_ENOSYS                 ENOSYS
460Sigor@sysoev.ru #define NXT_ECANCELED              ECANCELED
470Sigor@sysoev.ru #define NXT_EILSEQ                 EILSEQ
480Sigor@sysoev.ru #define NXT_ETIME                  ETIME
490Sigor@sysoev.ru #define NXT_ENOMOREFILES           0
501003Smax.romanov@nginx.com #define NXT_ENOBUFS                ENOBUFS
511439Svbart@nginx.com #define NXT_ERANGE                 ERANGE
520Sigor@sysoev.ru 
530Sigor@sysoev.ru #if (NXT_HPUX)
540Sigor@sysoev.ru /* HP-UX uses EWOULDBLOCK instead of EAGAIN. */
550Sigor@sysoev.ru #define NXT_EAGAIN                 EWOULDBLOCK
560Sigor@sysoev.ru #else
570Sigor@sysoev.ru #define NXT_EAGAIN                 EAGAIN
580Sigor@sysoev.ru #endif
590Sigor@sysoev.ru 
600Sigor@sysoev.ru 
610Sigor@sysoev.ru #define NXT_OK                     0
620Sigor@sysoev.ru #define NXT_ERROR                  (-1)
630Sigor@sysoev.ru #define NXT_AGAIN                  (-2)
640Sigor@sysoev.ru #define NXT_DECLINED               (-3)
650Sigor@sysoev.ru #define NXT_DONE                   (-4)
660Sigor@sysoev.ru 
670Sigor@sysoev.ru 
68*2084Salx.manpages@gmail.com #define nxt_errno                                                             \
690Sigor@sysoev.ru     errno
700Sigor@sysoev.ru 
71*2084Salx.manpages@gmail.com #define nxt_socket_errno                                                      \
720Sigor@sysoev.ru     errno
730Sigor@sysoev.ru 
74*2084Salx.manpages@gmail.com #define nxt_set_errno(err)                                                    \
750Sigor@sysoev.ru     errno = err
760Sigor@sysoev.ru 
77*2084Salx.manpages@gmail.com #define nxt_set_socket_errno(err)                                             \
780Sigor@sysoev.ru     errno = err
790Sigor@sysoev.ru 
800Sigor@sysoev.ru 
810Sigor@sysoev.ru nxt_int_t nxt_strerror_start(void);
820Sigor@sysoev.ru 
830Sigor@sysoev.ru 
840Sigor@sysoev.ru typedef u_char *(*nxt_strerror_t)(nxt_err_t err, u_char *errstr, size_t size);
850Sigor@sysoev.ru extern nxt_strerror_t  nxt_strerror;
860Sigor@sysoev.ru 
870Sigor@sysoev.ru 
880Sigor@sysoev.ru #endif /* _NXT_UNIX_ERRNO_H_INCLUDED_ */
89