diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-06-04 12:13:20 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-06-04 12:13:20 -0700 |
commit | 2ebaa5c8e1c3715c37ca72e6b687bd18bce14c10 (patch) | |
tree | 23be202f11606273b4c1295667db9079155ca6a0 | |
parent | 65748bb85593d38967a4e8d45476b4fc35558105 (diff) | |
parent | ab5249c775475008c6e640040d7284711a6d3348 (diff) |
Merge pull request #1225 from inolen/errno
synced library.js errno codes with sys/errno.h
-rw-r--r-- | src/library.js | 378 | ||||
-rwxr-xr-x | tests/runner.py | 4 | ||||
-rw-r--r-- | tests/unistd/login.out | 2 | ||||
-rw-r--r-- | tests/unistd/misc.out | 8 | ||||
-rw-r--r-- | tests/unistd/unlink.out | 2 |
5 files changed, 244 insertions, 150 deletions
diff --git a/src/library.js b/src/library.js index 1b4fd1d6..08cb3baf 100644 --- a/src/library.js +++ b/src/library.js @@ -6678,168 +6678,262 @@ LibraryManager.library = { // ========================================================================== $ERRNO_CODES: { + EPERM: 1, + ENOENT: 2, + ESRCH: 3, + EINTR: 4, + EIO: 5, + ENXIO: 6, E2BIG: 7, - EACCES: 13, - EADDRINUSE: 98, - EADDRNOTAVAIL: 99, - EAFNOSUPPORT: 97, - EAGAIN: 11, - EALREADY: 114, + ENOEXEC: 8, EBADF: 9, - EBADMSG: 74, - EBUSY: 16, - ECANCELED: 125, ECHILD: 10, - ECONNABORTED: 103, - ECONNREFUSED: 111, - ECONNRESET: 104, - EDEADLK: 35, - EDESTADDRREQ: 89, - EDOM: 33, - EDQUOT: 122, - EEXIST: 17, + EAGAIN: 11, + EWOULDBLOCK: 11, + ENOMEM: 12, + EACCES: 13, EFAULT: 14, - EFBIG: 27, - EHOSTUNREACH: 113, - EIDRM: 43, - EILSEQ: 84, - EINPROGRESS: 115, - EINTR: 4, - EINVAL: 22, - EIO: 5, - EISCONN: 106, - EISDIR: 21, - ELOOP: 40, - EMFILE: 24, - EMLINK: 31, - EMSGSIZE: 90, - EMULTIHOP: 72, - ENAMETOOLONG: 36, - ENETDOWN: 100, - ENETRESET: 102, - ENETUNREACH: 101, - ENFILE: 23, - ENOBUFS: 105, - ENODATA: 61, + ENOTBLK: 15, + EBUSY: 16, + EEXIST: 17, + EXDEV: 18, ENODEV: 19, - ENOENT: 2, - ENOEXEC: 8, - ENOLCK: 37, - ENOLINK: 67, - ENOMEM: 12, - ENOMSG: 42, - ENOPROTOOPT: 92, - ENOSPC: 28, - ENOSR: 63, - ENOSTR: 60, - ENOSYS: 38, - ENOTCONN: 107, ENOTDIR: 20, - ENOTEMPTY: 39, - ENOTRECOVERABLE: 131, - ENOTSOCK: 88, - ENOTSUP: 95, + EISDIR: 21, + EINVAL: 22, + ENFILE: 23, + EMFILE: 24, ENOTTY: 25, - ENXIO: 6, - EOPNOTSUPP: 45, - EOVERFLOW: 75, - EOWNERDEAD: 130, - EPERM: 1, + ETXTBSY: 26, + EFBIG: 27, + ENOSPC: 28, + ESPIPE: 29, + EROFS: 30, + EMLINK: 31, EPIPE: 32, - EPROTO: 71, - EPROTONOSUPPORT: 93, - EPROTOTYPE: 91, + EDOM: 33, ERANGE: 34, - EROFS: 30, - ESPIPE: 29, - ESRCH: 3, - ESTALE: 116, + ENOMSG: 35, + EIDRM: 36, + ECHRNG: 37, + EL2NSYNC: 38, + EL3HLT: 39, + EL3RST: 40, + ELNRNG: 41, + EUNATCH: 42, + ENOCSI: 43, + EL2HLT: 44, + EDEADLK: 45, + ENOLCK: 46, + EBADE: 50, + EBADR: 51, + EXFULL: 52, + ENOANO: 53, + EBADRQC: 54, + EBADSLT: 55, + EDEADLOCK: 56, + EBFONT: 57, + ENOSTR: 60, + ENODATA: 61, ETIME: 62, - ETIMEDOUT: 110, - ETXTBSY: 26, - EWOULDBLOCK: 11, - EXDEV: 18, + ENOSR: 63, + ENONET: 64, + ENOPKG: 65, + EREMOTE: 66, + ENOLINK: 67, + EADV: 68, + ESRMNT: 69, + ECOMM: 70, + EPROTO: 71, + EMULTIHOP: 74, + ELBIN: 75, + EDOTDOT: 76, + EBADMSG: 77, + EFTYPE: 79, + ENOTUNIQ: 80, + EBADFD: 81, + EREMCHG: 82, + ELIBACC: 83, + ELIBBAD: 84, + ELIBSCN: 85, + ELIBMAX: 86, + ELIBEXEC: 87, + ENOSYS: 88, + ENMFILE: 89, + ENOTEMPTY: 90, + ENAMETOOLONG: 91, + ELOOP: 92, + EOPNOTSUPP: 95, + EPFNOSUPPORT: 96, + ECONNRESET: 104, + ENOBUFS: 105, + EAFNOSUPPORT: 106, + EPROTOTYPE: 107, + ENOTSOCK: 108, + ENOPROTOOPT: 109, + ESHUTDOWN: 110, + ECONNREFUSED: 111, + EADDRINUSE: 112, + ECONNABORTED: 113, + ENETUNREACH: 114, + ENETDOWN: 115, + ETIMEDOUT: 116, + EHOSTDOWN: 117, + EHOSTUNREACH: 118, + EINPROGRESS: 119, + EALREADY: 120, + EDESTADDRREQ: 121, + EMSGSIZE: 122, + EPROTONOSUPPORT: 123, + ESOCKTNOSUPPORT: 124, + EADDRNOTAVAIL: 125, + ENETRESET: 126, + EISCONN: 127, + ENOTCONN: 128, + ETOOMANYREFS: 129, + EPROCLIM: 130, + EUSERS: 131, + EDQUOT: 132, + ESTALE: 133, + ENOTSUP: 134, + ENOMEDIUM: 135, + ENOSHARE: 136, + ECASECLASH: 137, + EILSEQ: 138, + EOVERFLOW: 139, + ECANCELED: 140, + ENOTRECOVERABLE: 141, + EOWNERDEAD: 142, + ESTRPIPE: 143 }, $ERRNO_MESSAGES: { + 0: 'Success', + 1: 'Not super-user', 2: 'No such file or directory', + 3: 'No such process', + 4: 'Interrupted system call', + 5: 'I/O error', + 6: 'No such device or address', + 7: 'Arg list too long', + 8: 'Exec format error', + 9: 'Bad file number', + 10: 'No children', + 11: 'No more processes', + 12: 'Not enough core', 13: 'Permission denied', - 98: 'Address already in use', - 99: 'Cannot assign requested address', - 97: 'Address family not supported by protocol', - 11: 'Resource temporarily unavailable', - 114: 'Operation already in progress', - 9: 'Bad file descriptor', - 74: 'Bad message', - 16: 'Device or resource busy', - 125: 'Operation canceled', - 10: 'No child processes', - 103: 'Software caused connection abort', - 111: 'Connection refused', - 104: 'Connection reset by peer', - 35: 'Resource deadlock avoided', - 89: 'Destination address required', - 33: 'Numerical argument out of domain', - 122: 'Disk quota exceeded', - 17: 'File exists', 14: 'Bad address', - 27: 'File too large', - 113: 'No route to host', - 43: 'Identifier removed', - 84: 'Invalid or incomplete multibyte or wide character', - 115: 'Operation now in progress', - 4: 'Interrupted system call', - 22: 'Invalid argument', - 5: 'Input/output error', - 106: 'Transport endpoint is already connected', + 15: 'Block device required', + 16: 'Mount device busy', + 17: 'File exists', + 18: 'Cross-device link', + 19: 'No such device', + 20: 'Not a directory', 21: 'Is a directory', - 40: 'Too many levels of symbolic links', - 24: 'Too many open files', - 31: 'Too many links', - 90: 'Message too long', - 72: 'Multihop attempted', - 36: 'File name too long', - 100: 'Network is down', - 102: 'Network dropped connection on reset', - 101: 'Network is unreachable', + 22: 'Invalid argument', 23: 'Too many open files in system', - 105: 'No buffer space available', - 61: 'No data available', - 19: 'No such device', - 8: 'Exec format error', - 37: 'No locks available', - 67: 'Link has been severed', - 12: 'Cannot allocate memory', - 42: 'No message of desired type', - 92: 'Protocol not available', + 24: 'Too many open files', + 25: 'Not a typewriter', + 26: 'Text file busy', + 27: 'File too large', 28: 'No space left on device', - 63: 'Out of streams resources', - 60: 'Device not a stream', - 38: 'Function not implemented', - 107: 'Transport endpoint is not connected', - 20: 'Not a directory', - 39: 'Directory not empty', - 131: 'State not recoverable', - 88: 'Socket operation on non-socket', - 95: 'Operation not supported', - 25: 'Inappropriate ioctl for device', - 6: 'No such device or address', - 45: 'Op not supported on transport endpoint', - 75: 'Value too large for defined data type', - 130: 'Owner died', - 1: 'Operation not permitted', - 32: 'Broken pipe', - 71: 'Protocol error', - 93: 'Protocol not supported', - 91: 'Protocol wrong type for socket', - 34: 'Numerical result out of range', - 30: 'Read-only file system', 29: 'Illegal seek', - 3: 'No such process', - 116: 'Stale NFS file handle', + 30: 'Read only file system', + 31: 'Too many links', + 32: 'Broken pipe', + 33: 'Math arg out of domain of func', + 34: 'Math result not representable', + 35: 'No message of desired type', + 36: 'Identifier removed', + 37: 'Channel number out of range', + 38: 'Level 2 not synchronized', + 39: 'Level 3 halted', + 40: 'Level 3 reset', + 41: 'Link number out of range', + 42: 'Protocol driver not attached', + 43: 'No CSI structure available', + 44: 'Level 2 halted', + 45: 'Deadlock condition', + 46: 'No record locks available', + 50: 'Invalid exchange', + 51: 'Invalid request descriptor', + 52: 'Exchange full', + 53: 'No anode', + 54: 'Invalid request code', + 55: 'Invalid slot', + 56: 'File locking deadlock error', + 57: 'Bad font file fmt', + 60: 'Device not a stream', + 61: 'No data (for no delay io)', 62: 'Timer expired', - 110: 'Connection timed out', - 26: 'Text file busy', - 18: 'Invalid cross-device link' + 63: 'Out of streams resources', + 64: 'Machine is not on the network', + 65: 'Package not installed', + 66: 'The object is remote', + 67: 'The link has been severed', + 68: 'Advertise error', + 69: 'Srmount error', + 70: 'Communication error on send', + 71: 'Protocol error', + 74: 'Multihop attempted', + 75: 'Inode is remote (not really error)', + 76: 'Cross mount point (not really error)', + 77: 'Trying to read unreadable message', + 79: 'Inappropriate file type or format', + 80: 'Given log. name not unique', + 81: 'f.d. invalid for this operation', + 82: 'Remote address changed', + 83: 'Can\t access a needed shared lib', + 84: 'Accessing a corrupted shared lib', + 85: '.lib section in a.out corrupted', + 86: 'Attempting to link in too many libs', + 87: 'Attempting to exec a shared library', + 88: 'Function not implemented', + 89: 'No more files', + 90: 'Directory not empty', + 91: 'File or path name too long', + 92: 'Too many symbolic links', + 95: 'Operation not supported on transport endpoint', + 96: 'Protocol family not supported', + 104: 'Connection reset by peer', + 105: 'No buffer space available', + 106: 'Address family not supported by protocol family', + 107: 'Protocol wrong type for socket', + 108: 'Socket operation on non-socket', + 109: 'Protocol not available', + 110: 'Can\'t send after socket shutdown', + 111: 'Connection refused', + 112: 'Address already in use', + 113: 'Connection aborted', + 114: 'Network is unreachable', + 115: 'Network interface is not configured', + 116: 'Connection timed out', + 117: 'Host is down', + 118: 'Host is unreachable', + 119: 'Connection already in progress', + 120: 'Socket already connected', + 121: 'Destination address required', + 122: 'Message too long', + 123: 'Unknown protocol', + 124: 'Socket type not supported', + 125: 'Address not available', + 126: 'ENETRESET', + 127: 'Socket is already connected', + 128: 'Socket is not connected', + 129: 'TOOMANYREFS', + 130: 'EPROCLIM', + 131: 'EUSERS', + 132: 'EDQUOT', + 133: 'ESTALE', + 134: 'Not supported', + 135: 'No medium (in tape drive)', + 136: 'No such host or network path', + 137: 'Filename exists with different case', + 138: 'EILSEQ', + 139: 'Value too large for defined data type', + 140: 'Operation canceled', + 141: 'State not recoverable', + 142: 'Previous owner died', + 143: 'Streams pipe error', }, __errno_state: 0, __setErrNo__deps: ['__errno_state'], diff --git a/tests/runner.py b/tests/runner.py index 803c1d2b..86e97b19 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -2244,8 +2244,8 @@ returned |umber one top notchfi FI FO FUM WHEN WHERE WHY HOW WHO|''', ['wowie', } ''' expected = ''' - <Numerical argument out of domain> - <Resource temporarily unavailable> + <Math arg out of domain of func> + <No more processes> <34> <123> ''' diff --git a/tests/unistd/login.out b/tests/unistd/login.out index c1919c3c..50e850ae 100644 --- a/tests/unistd/login.out +++ b/tests/unistd/login.out @@ -3,7 +3,7 @@ errno: 0 gethostname/2 ret: -1 gethostname/2: em------------------------ -errno: 36 +errno: 91 gethostname/256 ret: 0 gethostname/256: emscripten diff --git a/tests/unistd/misc.out b/tests/unistd/misc.out index a872a258..43971955 100644 --- a/tests/unistd/misc.out +++ b/tests/unistd/misc.out @@ -11,8 +11,8 @@ lockf(good): 0, errno: 0 lockf(bad): -1, errno: 9 nice: 0, errno: 1 pause: -1, errno: 4 -pipe(good): -1, errno: 38 -pipe(bad): -1, errno: 38 +pipe(good): -1, errno: 88 +pipe(bad): -1, errno: 88 execl: -1, errno: 8 execle: -1, errno: 8 execlp: -1, errno: 8 @@ -29,8 +29,8 @@ alarm: 0, errno: 0 ualarm: 0, errno: 0 fork: -1, errno: 11 vfork: -1, errno: 11 -crypt: (null), errno: 38 -encrypt, errno: 38 +crypt: (null), errno: 88 +encrypt, errno: 88 getgid: 0, errno: 0 getegid: 0, errno: 0 getuid: 0, errno: 0 diff --git a/tests/unistd/unlink.out b/tests/unistd/unlink.out index 1dcec761..f7a894cb 100644 --- a/tests/unistd/unlink.out +++ b/tests/unistd/unlink.out @@ -37,6 +37,6 @@ access(/empty-forbidden) after rmdir: 0 access(/full) before: 0 errno: 21 access(/full) after unlink: 0 -errno: 39 +errno: 90 access(/full) after rmdir: 0 |