cynix

x86 UNIX-like OS
git clone git://git.2f30.org/cynix
Log | Files | Refs | README | LICENSE

errno.h (2993B)


      1 /* POSIX error codes for system calls
      2  *
      3  * E2BIG       : argument list too long
      4  * EACCES      : permission denied
      5  * EAGAIN      : resource temporarily unavailable
      6  * EBADF       : bad file descriptor
      7  * EBADMSG     : bad message
      8  * EBUSY       : device or resource busy
      9  * ECANCELED   : operation canceled
     10  * ECHILD      : no child processes
     11  * EDEADLK     : resource deadlock avoided
     12  * EDOM        : mathematics argument out of domain of function
     13  * EEXIST      : file exists
     14  * EFAULT      : bad address
     15  * EFBIG       : file too large
     16  * EILSEQ      : illegal byte sequence
     17  * EINPROGRESS : operation in progress
     18  * EINTR       : interrupted function call
     19  * EINVAL      : invalid argument
     20  * EIO         : input/output error
     21  * EISDIR      : is a directory
     22  * EMFILE      : too many open files
     23  * EMLINK      : too many links
     24  * EMSGSIZE    : message too long
     25  * ENAMETOOLONG: filename too long
     26  * ENFILE      : too many open files in system
     27  * ENODEV      : no such device
     28  * ENOENT      : no such file or directory
     29  * ENOEXEC     : exec format error
     30  * ENOLCK      : no locks available
     31  * ENOMEM      : not enough space
     32  * ENOSPC      : no space left on device
     33  * ENOSYS      : function not implemented
     34  * ENOTDIR     : not a directory
     35  * ENOTEMPTY   : directory not empty
     36  * ENOTSUP     : operation not supported
     37  * ENOTTY      : inappropriate I/O control
     38  * ENXIO       : no such device or address
     39  * EPERM       : operation not permitted
     40  * EPIPE       : broken pipe
     41  * ERANGE      : result too large
     42  * EROFS       : read-only file system
     43  * ESPIPE      : invalid seek
     44  * ESRCH       : no such process
     45  * ETIMEDOUT   : connection timed out
     46  * EXDEV       : improper link
     47  */
     48 
     49 #ifndef __ERRNO_H__
     50 #define __ERRNO_H__
     51 
     52 #include <common.h>
     53 
     54 #define E2BIG         1
     55 #define EACCES        2
     56 #define EAGAIN        3
     57 #define EBADF         4
     58 #define EBADMSG       5
     59 #define EBUSY         6
     60 #define ECANCELED     7
     61 #define ECHILD        8
     62 #define EDEADLK       9
     63 #define EDOM         10
     64 #define EEXIST       11
     65 #define EFAULT       12
     66 #define EFBIG        13
     67 #define EILSEQ       14
     68 #define EINPROGRESS  15
     69 #define EINTR        16
     70 #define EINVAL       17
     71 #define EIO          18
     72 #define EISDIR       19
     73 #define EMFILE       20
     74 #define EMLINK       21
     75 #define EMSGSIZE     22
     76 #define ENAMETOOLONG 23
     77 #define ENFILE       24
     78 #define ENODEV       25
     79 #define ENOENT       26
     80 #define ENOEXEC      27
     81 #define ENOLCK       28
     82 #define ENOMEM       29
     83 #define ENOSPC       30
     84 #define ENOSYS       31
     85 #define ENOTDIR      32
     86 #define ENOTEMPTY    33
     87 #define ENOTSUP      34
     88 #define ENOTTY       35
     89 #define ENXIO        36
     90 #define EPERM        37
     91 #define EPIPE        38
     92 #define ERANGE       39
     93 #define EROFS        40
     94 #define ESPIPE       41
     95 #define ESRCH        42
     96 #define ETIMEDOUT    43
     97 #define EXDEV        44
     98 
     99 extern int errno;
    100 extern const char *sys_errlist [];
    101 
    102 static inline
    103 void kerror(int err)
    104 {
    105 	if (err < 1 || err > 44)
    106 		panic("Out of range!");
    107 	panic(sys_errlist[err - 1]);
    108 }
    109 
    110 #endif
    111