gonzui


Format: Advanced Search

t2ex/t2ex_source/include/t2ex/errno.hbare sourcepermlink (0.02 seconds)

Search this content:

    1: /*
    2:  *----------------------------------------------------------------------
    3:  *    T2EX Software Package
    4:  *
    5:  *    Copyright 2012 by Ken Sakamura.
    6:  *    This software is distributed under the latest version of T-License 2.x.
    7:  *----------------------------------------------------------------------
    8:  *
    9:  *    Released by T-Engine Forum(http://www.t-engine.org/) at 2012/12/12.
   10:  *    Modified by TRON Forum(http://www.tron.org/) at 2015/06/04.
   11:  *
   12:  *----------------------------------------------------------------------
   13:  */
   14: /*
   15:  * This software package is available for use, modification, 
   16:  * and redistribution in accordance with the terms of the attached 
   17:  * T-License 2.x.
   18:  * If you want to redistribute the source code, you need to attach 
   19:  * the T-License 2.x document.
   20:  * There's no obligation to publish the content, and no obligation 
   21:  * to disclose it to the TRON Forum if you have modified the 
   22:  * software package.
   23:  * You can also distribute the modified source code. In this case, 
   24:  * please register the modification to T-Kernel traceability service.
   25:  * People can know the history of modifications by the service, 
   26:  * and can be sure that the version you have inherited some 
   27:  * modification of a particular version or not.
   28:  *
   29:  *    http://trace.tron.org/tk/?lang=en
   30:  *    http://trace.tron.org/tk/?lang=ja
   31:  *
   32:  * As per the provisions of the T-License 2.x, TRON Forum ensures that 
   33:  * the portion of the software that is copyrighted by Ken Sakamura or 
   34:  * the TRON Forum does not infringe the copyrights of a third party.
   35:  * However, it does not make any warranty other than this.
   36:  * DISCLAIMER: TRON Forum and Ken Sakamura shall not be held
   37:  * responsible for any consequences or damages caused directly or
   38:  * indirectly by the use of this software package.
   39:  *
   40:  * The source codes in bsd_source.tar.gz in this software package are 
   41:  * derived from NetBSD or OpenBSD and not covered under T-License 2.x.
   42:  * They need to be changed or redistributed according to the 
   43:  * representation of each source header.
   44:  */
   45: 
   46: /*
   47:  *      @(#)errno.h
   48:  *
   49:  */
   50: 
   51: #ifndef __ERRNO_H__
   52: #define __ERRNO_H__
   53: 
   54: #include <tk/errno.h>
   55: 
   56: #ifdef  __cplusplus
   57: extern  "C" {
   58: #endif
   59: 
   60: /* Symbol to specify all tasks */
   61: #define TSK_ALL                 (-1)
   62: 
   63: /* Error number type */
   64: typedef int     errno_t;
   65: 
   66: /* Convert main and sub error code to TK2/T2EX error code */
   67: #ifndef ERCD
   68: #define ERCD(mer, ser)          ( ((mer) << 16) | ((ser) & 0xffff) )
   69: #endif
   70: 
   71: /* Main error code for T2EX extended error code */
   72: #ifndef EC_ERRNO
   73: #define EC_ERRNO                (-73)
   74: #endif
   75: 
   76: /* Convert T2EX extended error code to error number */
   77: #ifndef ERRNO
   78: #define ERRNO(er)               (MERCD(er) == EC_ERRNO ? SERCD(er) : 0)
   79: #endif
   80: 
   81: /* Convert error number to T2EX extended error code */
   82: #ifndef ERRNOtoER
   83: #define ERRNOtoER(eno)          (ERCD(EC_ERRNO, (eno)))
   84: #endif
   85: 
   86: /* 
   87:  *  Error numbers:
   88:  *      (*) will not occur in T2EX implementation
   89:  */
   90: #define EPERM           1        /* Operation not permitted             */
   91: #define ENOENT          2       /* No such file or directory          */
   92: #define ESRCH           3        /* No such process(*)                  */
   93: #define EINTR           4        /* Interrupted function                        */
   94: #define EIO             5  /* I/O error                             */
   95: #define ENXIO           6        /* No such device or address           */
   96: #define E2BIG           7        /* Argument list too long              */
   97: #define ENOEXEC         8      /* Executable file format error              */
   98: #define EBADF           9        /* Bad file descriptor                 */
   99: #define ECHILD          10      /* No child processes(*)             */
  100: #define EDEADLK         11     /* Resource deadlock would occur    */
  101: #define ENOMEM          12      /* Not enough space                  */
  102: #define EACCES          13      /* Permission denied                 */
  103: #define EFAULT          14      /* Bad address                               */
  104: 
  105: #define EBUSY           16       /* Device or resource busy            */
  106: #define EEXIST          17      /* File exists                               */
  107: #define EXDEV           18       /* Cross-device link                  */
  108: #define ENODEV          19      /* No such device                    */
  109: #define ENOTDIR         20     /* Not a director                   */
  110: #define EISDIR          21      /* Is a directory                    */
  111: #define EINVAL          22      /* Invalid argument                  */
  112: #define ENFILE          23      /* Too many files open in system     */
  113: #define EMFILE          24      /* File descriptor value too large(*)        */
  114: #define ENOTTY          25      /* Inappropriate I/O control operation       */
  115: 
  116: #define EFBIG           27       /* File too large                     */
  117: #define ENOSPC          28      /* No space left on device           */
  118: #define ESPIPE          29      /* Invalid seek                              */
  119: #define EROFS           30       /* Read-only file system              */
  120: #define EMLINK          31      /* Too many links(*)                 */
  121: #define EPIPE           32       /* Broken pipe(*)                     */
  122: #define EDOM            33        /* Mathematics argument
  123:                                         out of domain of function  */
  124: #define ERANGE          34      /* Result too large                  */
  125: #define EAGAIN          35      /* Resource unavailable, try again   */
  126: #define EWOULDBLOCK     EAGAIN      /* Operation would block             */
  127: #define EINPROGRESS     36  /* Operation in progress         */
  128: #define EALREADY        37     /* Connection already in progress   */
  129: #define ENOTSOCK        38     /* Not a socket                             */
  130: #define EDESTADDRREQ    39 /* Destination address required         */
  131: #define EMSGSIZE        40     /* Message too large                        */
  132: #define EPROTOTYPE      41   /* Protocol wrong type for socket */
  133: #define ENOPROTOOPT     42  /* Protocol not available                */
  134: #define EPROTONOSUPPORT 43      /* Unsupported protocol                      */
  135: #define ESOCKTNOSUPPORT 44      /* Unsupported socket type           */
  136: #define EOPNOTSUPP      45   /* Operation unsupported on socket        */
  137: #define EPFNOSUPPORT    46 /* Unsupported protocol family          */
  138: #define EAFNOSUPPORT    47 /* Address family unsupported by protocol */
  139: #define EADDRINUSE      48   /* Address in use                 */
  140: #define EADDRNOTAVAIL   49        /* Address not available               */
  141: #define ENETDOWN        50     /* Network is down                  */
  142: #define ENETUNREACH     51  /* Network unreachable                   */
  143: #define ENETRESET       52    /* Connection aborted by network   */
  144: #define ECONNABORTED    53 /* Connection aborted
  145:                                    (The problem of the local host side) */
  146: #define ECONNRESET      54   /* Connection reset(Reset by peer)        */
  147: #define ENOBUFS         55     /* No buffer space available                */
  148: #define EISCONN         56     /* Socket is connected                      */
  149: #define ENOTCONN        57     /* The socket is not connected              */
  150: #define ESHUTDOWN       58    /* Cannot send after transport
  151:                                                 endpoint shutdown */
  152: 
  153: #define ETIMEDOUT       60    /* Connection timed out                    */
  154: #define ECONNREFUSED    61 /* Connection refused(Rejected by peer) */
  155: #define ELOOP           62       /* Too many levels of symbolic links(*)       */
  156: #define ENAMETOOLONG    63 /* Filename too long                    */
  157: #define EHOSTDOWN       64    /* Remote host is down                     */
  158: #define EHOSTUNREACH    65 /* Host is unreachable                  */
  159: #define ENOTEMPTY       66    /* Directory not empty                     */
  160: 
  161: #define EDQUOT          69      /* Disk quota exceeded(*)            */
  162: 
  163: #define ENOLCK          77      /* No locks available(*)             */
  164: #define ENOSYS          78      /* Unsupported function                      */
  165: #define EFTYPE          79      /* Inappropriate file type or format */
  166: 
  167: #define EOVERFLOW       84    /* Value too large to be stored in data type */
  168: #define EILSEQ          85      /* Illegal byte sequence             */
  169: #define ENOTSUP         86     /* Unsupported                              */
  170: 
  171: #define ELAST           86       /* The last error number              */
  172: 
  173: 
  174: /* 
  175:  *  Error numbers for so_getaddrinfo() and so_getnameinfo()
  176:  */
  177: #define EAI_OFFSET      256
  178: #define EAI_AGAIN       (EAI_OFFSET +  2)     /* temporary failure in name resolution */
  179: #define EAI_BADFLAGS    (EAI_OFFSET +  3)  /* invalid value for ai_flags */
  180: #define EAI_FAIL        (EAI_OFFSET +  4)      /* non-recoverable failure in name resolution */
  181: #define EAI_FAMILY      (EAI_OFFSET +  5)    /* ai_family not supported */
  182: #define EAI_MEMORY      (EAI_OFFSET +  6)    /* memory allocation failure */
  183: #define EAI_NODATA      (EAI_OFFSET +  7)    /* no address associated with hostname */
  184: #define EAI_NONAME      (EAI_OFFSET +  8)    /* hostname nor servname provided, or not known */
  185: #define EAI_SERVICE     (EAI_OFFSET +  9)   /* servname not supported for ai_socktype */
  186: #define EAI_SOCKTYPE    (EAI_OFFSET + 10)  /* ai_socktype not supported */
  187: #define EAI_SYSTEM      (EAI_OFFSET + 11)    /* internal error */
  188: #define EAI_BADHINTS    (EAI_OFFSET + 12)  /* invalid value for hints */
  189: #define EAI_OVERFLOW    (EAI_OFFSET + 14)  /* argument buffer overflow */
  190: #define EAI_MAX         (EAI_OFFSET + 15)
  191: 
  192: 
  193: /*
  194:  *  T2EX extended error codes
  195:  */
  196: #define EX_PERM                 ERCD(EC_ERRNO, EPERM)
  197: #define EX_NOENT                ERCD(EC_ERRNO, ENOENT)
  198: #define EX_SRCH                 ERCD(EC_ERRNO, ESRCH)
  199: #define EX_IO                   ERCD(EC_ERRNO, EIO)
  200: #define EX_NXIO                 ERCD(EC_ERRNO, ENXIO)
  201: #define EX_2BIG                 ERCD(EC_ERRNO, E2BIG)
  202: #define EX_NOEXEC               ERCD(EC_ERRNO, ENOEXEC)
  203: #define EX_BADF                 ERCD(EC_ERRNO, EBADF)
  204: #define EX_CHILD                ERCD(EC_ERRNO, ECHILD)
  205: #define EX_AGAIN                ERCD(EC_ERRNO, EAGAIN)
  206: #define EX_DEADLK               ERCD(EC_ERRNO, EDEADLK)
  207: #define EX_NOMEM                ERCD(EC_ERRNO, ENOMEM)
  208: #define EX_ACCES                ERCD(EC_ERRNO, EACCES)
  209: #define EX_FAULT                ERCD(EC_ERRNO, EFAULT)
  210: #define EX_BUSY                 ERCD(EC_ERRNO, EBUSY)
  211: #define EX_EXIST                ERCD(EC_ERRNO, EEXIST)
  212: #define EX_XDEV                 ERCD(EC_ERRNO, EXDEV)
  213: #define EX_NODEV                ERCD(EC_ERRNO, ENODEV)
  214: #define EX_NOTDIR               ERCD(EC_ERRNO, ENOTDIR)
  215: #define EX_ISDIR                ERCD(EC_ERRNO, EISDIR)
  216: #define EX_INVAL                ERCD(EC_ERRNO, EINVAL)
  217: #define EX_NFILE                ERCD(EC_ERRNO, ENFILE)
  218: #define EX_MFILE                ERCD(EC_ERRNO, EMFILE)
  219: #define EX_NOTTY                ERCD(EC_ERRNO, ENOTTY)
  220: #define EX_FBIG                 ERCD(EC_ERRNO, EFBIG)
  221: #define EX_NOSPC                ERCD(EC_ERRNO, ENOSPC)
  222: #define EX_SPIPE                ERCD(EC_ERRNO, ESPIPE)
  223: #define EX_ROFS                 ERCD(EC_ERRNO, EROFS)
  224: #define EX_MLINK                ERCD(EC_ERRNO, EMLINK)
  225: #define EX_PIPE                 ERCD(EC_ERRNO, EPIPE)
  226: #define EX_DOM                  ERCD(EC_ERRNO, EDOM)
  227: #define EX_RANGE                ERCD(EC_ERRNO, ERANGE)
  228: #define EX_WOULDBLOCK           ERCD(EC_ERRNO, EWOULDBLOCK)
  229: #define EX_INPROGRESS           ERCD(EC_ERRNO, EINPROGRESS)
  230: #define EX_ALREADY              ERCD(EC_ERRNO, EALREADY)
  231: #define EX_NOTSOCK              ERCD(EC_ERRNO, ENOTSOCK)
  232: #define EX_DESTADDRREQ          ERCD(EC_ERRNO, EDESTADDRREQ)
  233: #define EX_MSGSIZE              ERCD(EC_ERRNO, EMSGSIZE)
  234: #define EX_PROTOTYPE            ERCD(EC_ERRNO, EPROTOTYPE)
  235: #define EX_NOPROTOOPT           ERCD(EC_ERRNO, ENOPROTOOPT)
  236: #define EX_PROTONOSUPPORT       ERCD(EC_ERRNO, EPROTONOSUPPORT)
  237: #define EX_SOCKTNOSUPPORT       ERCD(EC_ERRNO, ESOCKTNOSUPPORT)
  238: #define EX_OPNOTSUPP            ERCD(EC_ERRNO, EOPNOTSUPP)
  239: #define EX_PFNOSUPPORT          ERCD(EC_ERRNO, EPFNOSUPPORT)
  240: #define EX_AFNOSUPPORT          ERCD(EC_ERRNO, EAFNOSUPPORT)
  241: #define EX_ADDRINUSE            ERCD(EC_ERRNO, EADDRINUSE)
  242: #define EX_ADDRNOTAVAIL         ERCD(EC_ERRNO, EADDRNOTAVAIL)
  243: #define EX_NETDOWN              ERCD(EC_ERRNO, ENETDOWN)
  244: #define EX_NETUNREACH           ERCD(EC_ERRNO, ENETUNREACH)
  245: #define EX_NETRESET             ERCD(EC_ERRNO, ENETRESET)
  246: #define EX_CONNABORTED          ERCD(EC_ERRNO, ECONNABORTED)
  247: #define EX_CONNRESET            ERCD(EC_ERRNO, ECONNRESET)
  248: #define EX_NOBUFS               ERCD(EC_ERRNO, ENOBUFS)
  249: #define EX_ISCONN               ERCD(EC_ERRNO, EISCONN)
  250: #define EX_NOTCONN              ERCD(EC_ERRNO, ENOTCONN)
  251: #define EX_SHUTDOWN             ERCD(EC_ERRNO, ESHUTDOWN)
  252: #define EX_TIMEDOUT             ERCD(EC_ERRNO, ETIMEDOUT)
  253: #define EX_CONNREFUSED          ERCD(EC_ERRNO, ECONNREFUSED)
  254: #define EX_LOOP                 ERCD(EC_ERRNO, ELOOP)
  255: #define EX_NAMETOOLONG          ERCD(EC_ERRNO, ENAMETOOLONG)
  256: #define EX_HOSTDOWN             ERCD(EC_ERRNO, EHOSTDOWN)
  257: #define EX_HOSTUNREACH          ERCD(EC_ERRNO, EHOSTUNREACH)
  258: #define EX_NOTEMPTY             ERCD(EC_ERRNO, ENOTEMPTY)
  259: #define EX_DQUOT                ERCD(EC_ERRNO, EDQUOT)
  260: #define EX_NOLCK                ERCD(EC_ERRNO, ENOLCK)
  261: #define EX_NOSYS                ERCD(EC_ERRNO, ENOSYS)
  262: #define EX_FTYPE                ERCD(EC_ERRNO, EFTYPE)
  263: #define EX_ILSEQ                ERCD(EC_ERRNO, EILSEQ)
  264: #define EX_NOTSUP               ERCD(EC_ERRNO, ENOTSUP)
  265: #define EX_INTR                 ERCD(EC_ERRNO, EINTR)
  266: #define EX_OVERFLOW             ERCD(EC_ERRNO, EOVERFLOW)
  267: #define EX_AI_AGAIN             ERCD(EC_ERRNO, EAI_AGAIN)
  268: #define EX_AI_BADFLAGS          ERCD(EC_ERRNO, EAI_BADFLAGS)
  269: #define EX_AI_FAIL              ERCD(EC_ERRNO, EAI_FAIL)
  270: #define EX_AI_FAMILY            ERCD(EC_ERRNO, EAI_FAMILY)
  271: #define EX_AI_MEMORY            ERCD(EC_ERRNO, EAI_MEMORY)
  272: #define EX_AI_NODATA            ERCD(EC_ERRNO, EAI_NODATA)
  273: #define EX_AI_NONAME            ERCD(EC_ERRNO, EAI_NONAME)
  274: #define EX_AI_SERVICE           ERCD(EC_ERRNO, EAI_SERVICE)
  275: #define EX_AI_SOCKTYPE          ERCD(EC_ERRNO, EAI_SOCKTYPE)
  276: #define EX_AI_SYSTEM            ERCD(EC_ERRNO, EAI_SYSTEM)
  277: #define EX_AI_BADHINTS          ERCD(EC_ERRNO, EAI_BADHINTS)
  278: #define EX_AI_OVERFLOW          ERCD(EC_ERRNO, EAI_OVERFLOW)
  279: 
  280: #ifdef  __cplusplus
  281: }
  282: #endif
  283: 
  284: #endif /* __ERRNO_H__ */
  285: