* libc/include/sys/errno.h: Fix comments.
* libc/string/strerror.c: Fix documentation. (_strerror_r): Handle ENETRESET, EILSEQ, ENODATA, ECONNRESET, EADDRNOTAVAIL, EOVERFLOW. Fix strings for EMFILE and EDOM.
This commit is contained in:
parent
6aafa0bfc2
commit
e2b585c12c
|
@ -1,3 +1,10 @@
|
||||||
|
2014-07-14 Nick Withers <nick.withers@anu.edu.au>
|
||||||
|
|
||||||
|
* libc/include/sys/errno.h: Fix comments.
|
||||||
|
* libc/string/strerror.c: Fix documentation.
|
||||||
|
(_strerror_r): Handle ENETRESET, EILSEQ, ENODATA, ECONNRESET,
|
||||||
|
EADDRNOTAVAIL, EOVERFLOW. Fix strings for EMFILE and EDOM.
|
||||||
|
|
||||||
2014-07-11 Kévin Petit <kevin.petit@arm.com>
|
2014-07-11 Kévin Petit <kevin.petit@arm.com>
|
||||||
|
|
||||||
* libc/machine/aarch64/memchr.S: New file.
|
* libc/machine/aarch64/memchr.S: New file.
|
||||||
|
|
|
@ -28,7 +28,7 @@ extern __IMPORT char *program_invocation_short_name;
|
||||||
|
|
||||||
#define __errno_r(ptr) ((ptr)->_errno)
|
#define __errno_r(ptr) ((ptr)->_errno)
|
||||||
|
|
||||||
#define EPERM 1 /* Not super-user */
|
#define EPERM 1 /* Not owner */
|
||||||
#define ENOENT 2 /* No such file or directory */
|
#define ENOENT 2 /* No such file or directory */
|
||||||
#define ESRCH 3 /* No such process */
|
#define ESRCH 3 /* No such process */
|
||||||
#define EINTR 4 /* Interrupted system call */
|
#define EINTR 4 /* Interrupted system call */
|
||||||
|
@ -39,13 +39,13 @@ extern __IMPORT char *program_invocation_short_name;
|
||||||
#define EBADF 9 /* Bad file number */
|
#define EBADF 9 /* Bad file number */
|
||||||
#define ECHILD 10 /* No children */
|
#define ECHILD 10 /* No children */
|
||||||
#define EAGAIN 11 /* No more processes */
|
#define EAGAIN 11 /* No more processes */
|
||||||
#define ENOMEM 12 /* Not enough core */
|
#define ENOMEM 12 /* Not enough space */
|
||||||
#define EACCES 13 /* Permission denied */
|
#define EACCES 13 /* Permission denied */
|
||||||
#define EFAULT 14 /* Bad address */
|
#define EFAULT 14 /* Bad address */
|
||||||
#ifdef __LINUX_ERRNO_EXTENSIONS__
|
#ifdef __LINUX_ERRNO_EXTENSIONS__
|
||||||
#define ENOTBLK 15 /* Block device required */
|
#define ENOTBLK 15 /* Block device required */
|
||||||
#endif
|
#endif
|
||||||
#define EBUSY 16 /* Mount device busy */
|
#define EBUSY 16 /* Device or resource busy */
|
||||||
#define EEXIST 17 /* File exists */
|
#define EEXIST 17 /* File exists */
|
||||||
#define EXDEV 18 /* Cross-device link */
|
#define EXDEV 18 /* Cross-device link */
|
||||||
#define ENODEV 19 /* No such device */
|
#define ENODEV 19 /* No such device */
|
||||||
|
@ -53,17 +53,17 @@ extern __IMPORT char *program_invocation_short_name;
|
||||||
#define EISDIR 21 /* Is a directory */
|
#define EISDIR 21 /* Is a directory */
|
||||||
#define EINVAL 22 /* Invalid argument */
|
#define EINVAL 22 /* Invalid argument */
|
||||||
#define ENFILE 23 /* Too many open files in system */
|
#define ENFILE 23 /* Too many open files in system */
|
||||||
#define EMFILE 24 /* Too many open files */
|
#define EMFILE 24 /* File descriptor value too large */
|
||||||
#define ENOTTY 25 /* Not a typewriter */
|
#define ENOTTY 25 /* Not a character device */
|
||||||
#define ETXTBSY 26 /* Text file busy */
|
#define ETXTBSY 26 /* Text file busy */
|
||||||
#define EFBIG 27 /* File too large */
|
#define EFBIG 27 /* File too large */
|
||||||
#define ENOSPC 28 /* No space left on device */
|
#define ENOSPC 28 /* No space left on device */
|
||||||
#define ESPIPE 29 /* Illegal seek */
|
#define ESPIPE 29 /* Illegal seek */
|
||||||
#define EROFS 30 /* Read only file system */
|
#define EROFS 30 /* Read-only file system */
|
||||||
#define EMLINK 31 /* Too many links */
|
#define EMLINK 31 /* Too many links */
|
||||||
#define EPIPE 32 /* Broken pipe */
|
#define EPIPE 32 /* Broken pipe */
|
||||||
#define EDOM 33 /* Math arg out of domain of func */
|
#define EDOM 33 /* Mathematics argument out of domain of function */
|
||||||
#define ERANGE 34 /* Math result not representable */
|
#define ERANGE 34 /* Result too large */
|
||||||
#define ENOMSG 35 /* No message of desired type */
|
#define ENOMSG 35 /* No message of desired type */
|
||||||
#define EIDRM 36 /* Identifier removed */
|
#define EIDRM 36 /* Identifier removed */
|
||||||
#ifdef __LINUX_ERRNO_EXTENSIONS__
|
#ifdef __LINUX_ERRNO_EXTENSIONS__
|
||||||
|
@ -76,8 +76,8 @@ extern __IMPORT char *program_invocation_short_name;
|
||||||
#define ENOCSI 43 /* No CSI structure available */
|
#define ENOCSI 43 /* No CSI structure available */
|
||||||
#define EL2HLT 44 /* Level 2 halted */
|
#define EL2HLT 44 /* Level 2 halted */
|
||||||
#endif
|
#endif
|
||||||
#define EDEADLK 45 /* Deadlock condition */
|
#define EDEADLK 45 /* Deadlock */
|
||||||
#define ENOLCK 46 /* No record locks available */
|
#define ENOLCK 46 /* No lock */
|
||||||
#ifdef __LINUX_ERRNO_EXTENSIONS__
|
#ifdef __LINUX_ERRNO_EXTENSIONS__
|
||||||
#define EBADE 50 /* Invalid exchange */
|
#define EBADE 50 /* Invalid exchange */
|
||||||
#define EBADR 51 /* Invalid request descriptor */
|
#define EBADR 51 /* Invalid request descriptor */
|
||||||
|
@ -88,16 +88,16 @@ extern __IMPORT char *program_invocation_short_name;
|
||||||
#define EDEADLOCK 56 /* File locking deadlock error */
|
#define EDEADLOCK 56 /* File locking deadlock error */
|
||||||
#define EBFONT 57 /* Bad font file fmt */
|
#define EBFONT 57 /* Bad font file fmt */
|
||||||
#endif
|
#endif
|
||||||
#define ENOSTR 60 /* Device not a stream */
|
#define ENOSTR 60 /* Not a stream */
|
||||||
#define ENODATA 61 /* No data (for no delay io) */
|
#define ENODATA 61 /* No data (for no delay io) */
|
||||||
#define ETIME 62 /* Timer expired */
|
#define ETIME 62 /* Stream ioctl timeout */
|
||||||
#define ENOSR 63 /* Out of streams resources */
|
#define ENOSR 63 /* No stream resources */
|
||||||
#ifdef __LINUX_ERRNO_EXTENSIONS__
|
#ifdef __LINUX_ERRNO_EXTENSIONS__
|
||||||
#define ENONET 64 /* Machine is not on the network */
|
#define ENONET 64 /* Machine is not on the network */
|
||||||
#define ENOPKG 65 /* Package not installed */
|
#define ENOPKG 65 /* Package not installed */
|
||||||
#define EREMOTE 66 /* The object is remote */
|
#define EREMOTE 66 /* The object is remote */
|
||||||
#endif
|
#endif
|
||||||
#define ENOLINK 67 /* The link has been severed */
|
#define ENOLINK 67 /* Virtual circuit is gone */
|
||||||
#ifdef __LINUX_ERRNO_EXTENSIONS__
|
#ifdef __LINUX_ERRNO_EXTENSIONS__
|
||||||
#define EADV 68 /* Advertise error */
|
#define EADV 68 /* Advertise error */
|
||||||
#define ESRMNT 69 /* Srmount error */
|
#define ESRMNT 69 /* Srmount error */
|
||||||
|
@ -109,7 +109,7 @@ extern __IMPORT char *program_invocation_short_name;
|
||||||
#define ELBIN 75 /* Inode is remote (not really error) */
|
#define ELBIN 75 /* Inode is remote (not really error) */
|
||||||
#define EDOTDOT 76 /* Cross mount point (not really error) */
|
#define EDOTDOT 76 /* Cross mount point (not really error) */
|
||||||
#endif
|
#endif
|
||||||
#define EBADMSG 77 /* Trying to read unreadable message */
|
#define EBADMSG 77 /* Bad message */
|
||||||
#define EFTYPE 79 /* Inappropriate file type or format */
|
#define EFTYPE 79 /* Inappropriate file type or format */
|
||||||
#ifdef __LINUX_ERRNO_EXTENSIONS__
|
#ifdef __LINUX_ERRNO_EXTENSIONS__
|
||||||
#define ENOTUNIQ 80 /* Given log. name not unique */
|
#define ENOTUNIQ 80 /* Given log. name not unique */
|
||||||
|
@ -128,7 +128,7 @@ extern __IMPORT char *program_invocation_short_name;
|
||||||
#define ENOTEMPTY 90 /* Directory not empty */
|
#define ENOTEMPTY 90 /* Directory not empty */
|
||||||
#define ENAMETOOLONG 91 /* File or path name too long */
|
#define ENAMETOOLONG 91 /* File or path name too long */
|
||||||
#define ELOOP 92 /* Too many symbolic links */
|
#define ELOOP 92 /* Too many symbolic links */
|
||||||
#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
|
#define EOPNOTSUPP 95 /* Operation not supported on socket */
|
||||||
#define EPFNOSUPPORT 96 /* Protocol family not supported */
|
#define EPFNOSUPPORT 96 /* Protocol family not supported */
|
||||||
#define ECONNRESET 104 /* Connection reset by peer */
|
#define ECONNRESET 104 /* Connection reset by peer */
|
||||||
#define ENOBUFS 105 /* No buffer space available */
|
#define ENOBUFS 105 /* No buffer space available */
|
||||||
|
@ -141,7 +141,7 @@ extern __IMPORT char *program_invocation_short_name;
|
||||||
#endif
|
#endif
|
||||||
#define ECONNREFUSED 111 /* Connection refused */
|
#define ECONNREFUSED 111 /* Connection refused */
|
||||||
#define EADDRINUSE 112 /* Address already in use */
|
#define EADDRINUSE 112 /* Address already in use */
|
||||||
#define ECONNABORTED 113 /* Connection aborted */
|
#define ECONNABORTED 113 /* Software caused connection abort */
|
||||||
#define ENETUNREACH 114 /* Network is unreachable */
|
#define ENETUNREACH 114 /* Network is unreachable */
|
||||||
#define ENETDOWN 115 /* Network interface is not configured */
|
#define ENETDOWN 115 /* Network interface is not configured */
|
||||||
#define ETIMEDOUT 116 /* Connection timed out */
|
#define ETIMEDOUT 116 /* Connection timed out */
|
||||||
|
@ -156,7 +156,7 @@ extern __IMPORT char *program_invocation_short_name;
|
||||||
#define ESOCKTNOSUPPORT 124 /* Socket type not supported */
|
#define ESOCKTNOSUPPORT 124 /* Socket type not supported */
|
||||||
#endif
|
#endif
|
||||||
#define EADDRNOTAVAIL 125 /* Address not available */
|
#define EADDRNOTAVAIL 125 /* Address not available */
|
||||||
#define ENETRESET 126
|
#define ENETRESET 126 /* Connection aborted by network */
|
||||||
#define EISCONN 127 /* Socket is already connected */
|
#define EISCONN 127 /* Socket is already connected */
|
||||||
#define ENOTCONN 128 /* Socket is not connected */
|
#define ENOTCONN 128 /* Socket is not connected */
|
||||||
#define ETOOMANYREFS 129
|
#define ETOOMANYREFS 129
|
||||||
|
@ -174,7 +174,7 @@ extern __IMPORT char *program_invocation_short_name;
|
||||||
#define ENOSHARE 136 /* No such host or network path */
|
#define ENOSHARE 136 /* No such host or network path */
|
||||||
#define ECASECLASH 137 /* Filename exists with different case */
|
#define ECASECLASH 137 /* Filename exists with different case */
|
||||||
#endif
|
#endif
|
||||||
#define EILSEQ 138
|
#define EILSEQ 138 /* Illegal byte sequence */
|
||||||
#define EOVERFLOW 139 /* Value too large for defined data type */
|
#define EOVERFLOW 139 /* Value too large for defined data type */
|
||||||
#define ECANCELED 140 /* Operation canceled */
|
#define ECANCELED 140 /* Operation canceled */
|
||||||
#define ENOTRECOVERABLE 141 /* State not recoverable */
|
#define ENOTRECOVERABLE 141 /* State not recoverable */
|
||||||
|
|
|
@ -45,6 +45,9 @@ Permission denied
|
||||||
o EADDRINUSE
|
o EADDRINUSE
|
||||||
Address already in use
|
Address already in use
|
||||||
|
|
||||||
|
o EADDRNOTAVAIL
|
||||||
|
Address not available
|
||||||
|
|
||||||
o EADV
|
o EADV
|
||||||
Advertise error
|
Advertise error
|
||||||
|
|
||||||
|
@ -66,6 +69,9 @@ Bad message
|
||||||
o EBUSY
|
o EBUSY
|
||||||
Device or resource busy
|
Device or resource busy
|
||||||
|
|
||||||
|
o ECANCELED
|
||||||
|
Operation canceled
|
||||||
|
|
||||||
o ECHILD
|
o ECHILD
|
||||||
No children
|
No children
|
||||||
|
|
||||||
|
@ -78,6 +84,9 @@ Software caused connection abort
|
||||||
o ECONNREFUSED
|
o ECONNREFUSED
|
||||||
Connection refused
|
Connection refused
|
||||||
|
|
||||||
|
o ECONNRESET
|
||||||
|
Connection reset by peer
|
||||||
|
|
||||||
o EDEADLK
|
o EDEADLK
|
||||||
Deadlock
|
Deadlock
|
||||||
|
|
||||||
|
@ -88,7 +97,7 @@ o EEXIST
|
||||||
File exists
|
File exists
|
||||||
|
|
||||||
o EDOM
|
o EDOM
|
||||||
Math argument
|
Mathematics argument out of domain of function
|
||||||
|
|
||||||
o EFAULT
|
o EFAULT
|
||||||
Bad address
|
Bad address
|
||||||
|
@ -105,6 +114,9 @@ Host is unreachable
|
||||||
o EIDRM
|
o EIDRM
|
||||||
Identifier removed
|
Identifier removed
|
||||||
|
|
||||||
|
o EILSEQ
|
||||||
|
Illegal byte sequence
|
||||||
|
|
||||||
o EINPROGRESS
|
o EINPROGRESS
|
||||||
Connection already in progress
|
Connection already in progress
|
||||||
|
|
||||||
|
@ -139,7 +151,7 @@ o ELIBSCN
|
||||||
<<.lib>> section in a.out corrupted
|
<<.lib>> section in a.out corrupted
|
||||||
|
|
||||||
o EMFILE
|
o EMFILE
|
||||||
Too many open files
|
File descriptor value too large
|
||||||
|
|
||||||
o EMLINK
|
o EMLINK
|
||||||
Too many links
|
Too many links
|
||||||
|
@ -154,7 +166,10 @@ o ENAMETOOLONG
|
||||||
File or path name too long
|
File or path name too long
|
||||||
|
|
||||||
o ENETDOWN
|
o ENETDOWN
|
||||||
Network interface not configured
|
Network interface is not configured
|
||||||
|
|
||||||
|
o ENETRESET
|
||||||
|
Connection aborted by network
|
||||||
|
|
||||||
o ENETUNREACH
|
o ENETUNREACH
|
||||||
Network is unreachable
|
Network is unreachable
|
||||||
|
@ -162,6 +177,12 @@ Network is unreachable
|
||||||
o ENFILE
|
o ENFILE
|
||||||
Too many open files in system
|
Too many open files in system
|
||||||
|
|
||||||
|
o ENOBUFS
|
||||||
|
No buffer space available
|
||||||
|
|
||||||
|
o ENODATA
|
||||||
|
No data
|
||||||
|
|
||||||
o ENODEV
|
o ENODEV
|
||||||
No such device
|
No such device
|
||||||
|
|
||||||
|
@ -216,6 +237,9 @@ Not a directory
|
||||||
o ENOTEMPTY
|
o ENOTEMPTY
|
||||||
Directory not empty
|
Directory not empty
|
||||||
|
|
||||||
|
o ENOTRECOVERABLE
|
||||||
|
State not recoverable
|
||||||
|
|
||||||
o ENOTSOCK
|
o ENOTSOCK
|
||||||
Socket operation on non-socket
|
Socket operation on non-socket
|
||||||
|
|
||||||
|
@ -228,6 +252,15 @@ Not a character device
|
||||||
o ENXIO
|
o ENXIO
|
||||||
No such device or address
|
No such device or address
|
||||||
|
|
||||||
|
o EOPNOTSUPP
|
||||||
|
Operation not supported on socket
|
||||||
|
|
||||||
|
o EOVERFLOW
|
||||||
|
Value too large for defined data type
|
||||||
|
|
||||||
|
o EOWNERDEAD
|
||||||
|
Previous owner died
|
||||||
|
|
||||||
o EPERM
|
o EPERM
|
||||||
Not owner
|
Not owner
|
||||||
|
|
||||||
|
@ -267,6 +300,9 @@ No such process
|
||||||
o ESRMNT
|
o ESRMNT
|
||||||
Srmount error
|
Srmount error
|
||||||
|
|
||||||
|
o ESTRPIPE
|
||||||
|
Strings pipe error
|
||||||
|
|
||||||
o ETIME
|
o ETIME
|
||||||
Stream ioctl timeout
|
Stream ioctl timeout
|
||||||
|
|
||||||
|
@ -276,21 +312,12 @@ Connection timed out
|
||||||
o ETXTBSY
|
o ETXTBSY
|
||||||
Text file busy
|
Text file busy
|
||||||
|
|
||||||
|
o EWOULDBLOCK
|
||||||
|
EAGAIN
|
||||||
|
|
||||||
o EXDEV
|
o EXDEV
|
||||||
Cross-device link
|
Cross-device link
|
||||||
|
|
||||||
o ECANCELED
|
|
||||||
Operation canceled
|
|
||||||
|
|
||||||
o ENOTRECOVERABLE
|
|
||||||
State not recoverable
|
|
||||||
|
|
||||||
o EOWNERDEAD
|
|
||||||
Previous owner died
|
|
||||||
|
|
||||||
o ESTRPIPE
|
|
||||||
Strings pipe error
|
|
||||||
|
|
||||||
o-
|
o-
|
||||||
|
|
||||||
<<_strerror_r>> is a reentrant version of the above.
|
<<_strerror_r>> is a reentrant version of the above.
|
||||||
|
@ -504,6 +531,11 @@ _DEFUN (_strerror_r, (ptr, errnum, internal, errptr),
|
||||||
error = "Network interface is not configured";
|
error = "Network interface is not configured";
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ENETRESET
|
||||||
|
case ENETRESET:
|
||||||
|
error = "Connection aborted by network";
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
#ifdef ENFILE
|
#ifdef ENFILE
|
||||||
case ENFILE:
|
case ENFILE:
|
||||||
error = "Too many open files in system";
|
error = "Too many open files in system";
|
||||||
|
@ -511,7 +543,7 @@ _DEFUN (_strerror_r, (ptr, errnum, internal, errptr),
|
||||||
#endif
|
#endif
|
||||||
#ifdef EMFILE
|
#ifdef EMFILE
|
||||||
case EMFILE:
|
case EMFILE:
|
||||||
error = "Too many open files";
|
error = "File descriptor value too large";
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENOTTY
|
#ifdef ENOTTY
|
||||||
|
@ -566,7 +598,7 @@ _DEFUN (_strerror_r, (ptr, errnum, internal, errptr),
|
||||||
#endif
|
#endif
|
||||||
#ifdef EDOM
|
#ifdef EDOM
|
||||||
case EDOM:
|
case EDOM:
|
||||||
error = "Math argument";
|
error = "Mathematics argument out of domain of function";
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ERANGE
|
#ifdef ERANGE
|
||||||
|
@ -584,6 +616,11 @@ _DEFUN (_strerror_r, (ptr, errnum, internal, errptr),
|
||||||
error = "Identifier removed";
|
error = "Identifier removed";
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef EILSEQ
|
||||||
|
case EILSEQ:
|
||||||
|
error = "Illegal byte sequence";
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
#ifdef EDEADLK
|
#ifdef EDEADLK
|
||||||
case EDEADLK:
|
case EDEADLK:
|
||||||
error = "Deadlock";
|
error = "Deadlock";
|
||||||
|
@ -724,6 +761,11 @@ _DEFUN (_strerror_r, (ptr, errnum, internal, errptr),
|
||||||
error = "No buffer space available";
|
error = "No buffer space available";
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ENODATA
|
||||||
|
case ENODATA:
|
||||||
|
error = "No data";
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
#ifdef EAFNOSUPPORT
|
#ifdef EAFNOSUPPORT
|
||||||
case EAFNOSUPPORT:
|
case EAFNOSUPPORT:
|
||||||
error = "Address family not supported by protocol family";
|
error = "Address family not supported by protocol family";
|
||||||
|
@ -754,11 +796,21 @@ _DEFUN (_strerror_r, (ptr, errnum, internal, errptr),
|
||||||
error = "Connection refused";
|
error = "Connection refused";
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ECONNRESET
|
||||||
|
case ECONNRESET:
|
||||||
|
error = "Connection reset by peer";
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
#ifdef EADDRINUSE
|
#ifdef EADDRINUSE
|
||||||
case EADDRINUSE:
|
case EADDRINUSE:
|
||||||
error = "Address already in use";
|
error = "Address already in use";
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef EADDRNOTAVAIL
|
||||||
|
case EADDRNOTAVAIL:
|
||||||
|
error = "Address not available";
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
#ifdef ECONNABORTED
|
#ifdef ECONNABORTED
|
||||||
case ECONNABORTED:
|
case ECONNABORTED:
|
||||||
error = "Software caused connection abort";
|
error = "Software caused connection abort";
|
||||||
|
@ -809,6 +861,11 @@ _DEFUN (_strerror_r, (ptr, errnum, internal, errptr),
|
||||||
error = "Operation not supported on socket";
|
error = "Operation not supported on socket";
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef EOVERFLOW
|
||||||
|
case EOVERFLOW:
|
||||||
|
error = "Value too large for defined data type";
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
#ifdef EMSGSIZE
|
#ifdef EMSGSIZE
|
||||||
case EMSGSIZE:
|
case EMSGSIZE:
|
||||||
error = "Message too long";
|
error = "Message too long";
|
||||||
|
|
Loading…
Reference in New Issue