import libc;

errno() = libc._errno()^;

alias EPERM           = 1;       /* Operation not permitted */
alias ENOFILE         = 2;       /* No such file or directory */
alias ENOENT          = 2;
alias ESRCH           = 3;       /* No such process */
alias EINTR           = 4;       /* Interrupted function call */
alias EIO             = 5;       /* Input/output error */
alias ENXIO           = 6;       /* No such device or address */
alias E2BIG           = 7;       /* Arg list too long */
alias ENOEXEC         = 8;       /* Exec format error */
alias EBADF           = 9;       /* Bad file descriptor */
alias ECHILD          = 10;      /* No child processes */
alias EAGAIN          = 11;      /* Resource temporarily unavailable */
alias ENOMEM          = 12;      /* Not enough space */
alias EACCES          = 13;      /* Permission denied */
alias EFAULT          = 14;      /* Bad address */
/* 15 - Unknown Error */
alias EBUSY           = 16;      /* strerror reports "Resource device" */
alias EEXIST          = 17;      /* File exists */
alias EXDEV           = 18;      /* Improper link (cross-device link?) */
alias ENODEV          = 19;      /* No such device */
alias ENOTDIR         = 20;      /* Not a directory */
alias EISDIR          = 21;      /* Is a directory */
alias EINVAL          = 22;      /* Invalid argument */
alias ENFILE          = 23;      /* Too many open files in system */
alias EMFILE          = 24;      /* Too many open files */
alias ENOTTY          = 25;      /* Inappropriate I/O control operation */
/* 26 - Unknown Error */
alias EFBIG           = 27;      /* File too large */
alias ENOSPC          = 28;      /* No space left on device */
alias ESPIPE          = 29;      /* Invalid seek (seek on a pipe?) */
alias EROFS           = 30;      /* Read-only file system */
alias EMLINK          = 31;      /* Too many links */
alias EPIPE           = 32;      /* Broken pipe */
alias EDOM            = 33;      /* Domain error (math functions) */
alias ERANGE          = 34;      /* Result too large (possibly too small) */
/* 35 - Unknown Error */
alias EDEADLOCK       = 36;      /* Resource deadlock avoided (non-Cyg) */
alias EDEADLK         = 36;
/* 37 - Unknown Error */
alias ENAMETOOLONG    = 38;      /* Filename too long (91 in Cyg?) */
alias ENOLCK          = 39;      /* No locks available (46 in Cyg?) */
alias ENOSYS          = 40;      /* Function not implemented (88 in Cyg?) */
alias ENOTEMPTY       = 41;      /* Directory not empty (90 in Cyg?) */
alias EILSEQ          = 42;      /* Illegal byte sequence */
