improve error strings

this definitely has the potential to be a bikeshed topic, so some
justification is in order. most of the changes made fit into one of
the following categories:
1. alignment with text in posix, xsh 2.3
2. eliminating overly-specific text for shared error codes
3. making the message match more closely with the macro name
4. removing extraneous words

in particular, the EAGAIN/EWOULDBLOCK text is updated to match the
description of EAGAIN (which covers both uses) rather than saying the
operation would block, and ENOTSUP/EOPNOTSUPP is updated not to
mention sockets.

the distinction between ENFILE/EMFILE has also been clarified; ENFILE
is aligned with the posix text, and EMFILE, which lacks concise posix
text matching any historic message, is updated to emphasize that the
exhausted resource is not open files/open file descriptions, but
rather the integer 'address space' of file descriptors.

some messages may be further tweaked based on feedback.
This commit is contained in:
Rich Felker 2013-02-07 03:05:54 -05:00
parent 526900484c
commit d75348ddda

View File

@ -5,7 +5,7 @@
* of the strings remains synchronized. */ * of the strings remains synchronized. */
E(EILSEQ, "Illegal byte sequence") E(EILSEQ, "Illegal byte sequence")
E(EDOM, "Argument outside domain") E(EDOM, "Domain error")
E(ERANGE, "Result not representable") E(ERANGE, "Result not representable")
E(ENOTTY, "Not a tty") E(ENOTTY, "Not a tty")
@ -15,25 +15,25 @@ E(ENOENT, "No such file or directory")
E(ESRCH, "No such process") E(ESRCH, "No such process")
E(EEXIST, "File exists") E(EEXIST, "File exists")
E(EOVERFLOW, "Value too large for defined data type") E(EOVERFLOW, "Value too large for data type")
E(ENOSPC, "No space left on device") E(ENOSPC, "No space left on device")
E(ENOMEM, "Out of memory") E(ENOMEM, "Out of memory")
E(EBUSY, "Device or resource busy") E(EBUSY, "Resource busy")
E(EINTR, "Interrupted system call") E(EINTR, "Interrupted system call")
E(EAGAIN, "Operation would block") E(EAGAIN, "Resource temporarily unavailable")
E(ESPIPE, "Illegal seek") E(ESPIPE, "Invalid seek")
E(EXDEV, "Cross-device link") E(EXDEV, "Cross-device link")
E(EROFS, "Read-only file system") E(EROFS, "Read-only file system")
E(ENOTEMPTY, "Directory not empty") E(ENOTEMPTY, "Directory not empty")
E(ECONNRESET, "Connection reset by peer") E(ECONNRESET, "Connection reset by peer")
E(ETIMEDOUT, "Connection timed out") E(ETIMEDOUT, "Operation timed out")
E(ECONNREFUSED, "Connection refused") E(ECONNREFUSED, "Connection refused")
E(EHOSTDOWN, "Host is down") E(EHOSTDOWN, "Host is down")
E(EHOSTUNREACH, "No route to host") E(EHOSTUNREACH, "Host is unreachable")
E(EADDRINUSE, "Address already in use") E(EADDRINUSE, "Address in use")
E(EPIPE, "Broken pipe") E(EPIPE, "Broken pipe")
E(EIO, "I/O error") E(EIO, "I/O error")
@ -48,51 +48,54 @@ E(ENOEXEC, "Exec format error")
E(EINVAL, "Invalid argument") E(EINVAL, "Invalid argument")
E(E2BIG, "Argument list too long") E(E2BIG, "Argument list too long")
E(ELOOP, "Too many levels of symbolic links") E(ELOOP, "Symbolic link loop")
E(ENAMETOOLONG, "Filename too long") E(ENAMETOOLONG, "Filename too long")
E(ENFILE, "File table overflow") E(ENFILE, "Too many open files in system")
E(EMFILE, "Too many open files") E(EMFILE, "No file descriptors available")
E(EBADF, "Bad file number") E(EBADF, "Bad file descriptor")
E(ECHILD, "No child processes") E(ECHILD, "No child process")
E(EFAULT, "Bad address") E(EFAULT, "Bad address")
E(EFBIG, "File too large") E(EFBIG, "File too large")
E(EMLINK, "Too many links") E(EMLINK, "Too many links")
E(ENOLCK, "No record locks available") E(ENOLCK, "No locks available")
E(EDEADLK, "Resource deadlock would occur") E(EDEADLK, "Resource deadlock would occur")
E(ENOSYS, "Function not supported") E(ENOTRECOVERABLE, "State not recoverable")
E(EOWNERDEAR, "Previous owner died")
E(ECANCELED, "Operation canceled")
E(ENOSYS, "Function not implemented")
E(ENOMSG, "No message of desired type") E(ENOMSG, "No message of desired type")
E(EIDRM, "Identifier removed") E(EIDRM, "Identifier removed")
E(ENOSTR, "Device not a stream") E(ENOSTR, "Device not a stream")
E(ENODATA, "No data available") E(ENODATA, "No data available")
E(ETIME, "Timer expired") E(ETIME, "Device timeout")
E(ENOSR, "Out of streams resources") E(ENOSR, "Out of streams resources")
E(ENOLINK, "Link has been severed") E(ENOLINK, "Link has been severed")
E(EPROTO, "Protocol error") E(EPROTO, "Protocol error")
E(EBADMSG, "Not a data message") E(EBADMSG, "Bad message")
E(EBADFD, "File descriptor in bad state") E(EBADFD, "File descriptor in bad state")
E(ENOTSOCK, "Socket operation on non-socket") E(ENOTSOCK, "Not a socket")
E(EDESTADDRREQ, "Destination address required") E(EDESTADDRREQ, "Destination address required")
E(EMSGSIZE, "Message too long") E(EMSGSIZE, "Message too large")
E(EPROTOTYPE, "Protocol wrong type for socket") E(EPROTOTYPE, "Protocol wrong type for socket")
E(ENOPROTOOPT, "Protocol not available") E(ENOPROTOOPT, "Protocol not available")
E(EPROTONOSUPPORT,"Protocol not supported") E(EPROTONOSUPPORT,"Protocol not supported")
E(ESOCKTNOSUPPORT,"Socket type not supported") E(ESOCKTNOSUPPORT,"Socket type not supported")
E(EOPNOTSUPP, "Operation not supported on socket") E(ENOTSUP, "Not supported")
E(EPFNOSUPPORT, "Protocol family not supported") E(EPFNOSUPPORT, "Protocol family not supported")
E(EAFNOSUPPORT, "Address family not supported by protocol") E(EAFNOSUPPORT, "Address family not supported by protocol")
E(EADDRNOTAVAIL,"Cannot assign requested address") E(EADDRNOTAVAIL,"Address not available")
E(ENETDOWN, "Network is down") E(ENETDOWN, "Network is down")
E(ENETUNREACH, "Network is unreachable") E(ENETUNREACH, "Network unreachable")
E(ENETRESET, "Network dropped connection because of reset") E(ENETRESET, "Connection reset by network")
E(ECONNABORTED, "Software caused connection abort") E(ECONNABORTED, "Connection aborted")
E(ENOBUFS, "No buffer space available") E(ENOBUFS, "No buffer space available")
E(EISCONN, "Socket is connected") E(EISCONN, "Socket is connected")
E(ENOTCONN, "Socket is not connected") E(ENOTCONN, "Socket not connected")
E(ESHUTDOWN, "Cannot send after socket shutdown") E(ESHUTDOWN, "Cannot send after socket shutdown")
E(EALREADY, "Operation already in progress") E(EALREADY, "Operation already in progress")
E(EINPROGRESS, "Operation now in progress") E(EINPROGRESS, "Operation in progress")
E(ESTALE, "Stale NFS file handle") E(ESTALE, "Stale file handle")
E(EREMOTEIO, "Remote I/O error") E(EREMOTEIO, "Remote I/O error")
E(EDQUOT, "Quota exceeded") E(EDQUOT, "Quota exceeded")
E(ENOMEDIUM, "No medium found") E(ENOMEDIUM, "No medium found")