2 **** CAUTION!!! KEEP DOC CONSISTENT---if you change text of a message
3 **** here, change two places:
4 **** 1) the leading doc section (alphabetized by macro)
5 **** 2) the real text inside switch(errnum)
10 <<strerror>>---convert error number to string
17 char *strerror(int <[errnum]>);
21 char *strerror(<[errnum]>)
25 <<strerror>> converts the error number <[errnum]> into a
26 string. The value of <[errnum]> is usually a copy of <<errno>>.
27 If <<errnum>> is not a known error number, the result points to an
30 This implementation of <<strerror>> prints out the following strings
31 for each of the values defined in `<<errno.h>>':
41 Address already in use
47 Address family not supported by protocol family
53 Socket already connected
62 Device or resource busy
71 Software caused connection abort
80 Destination address required
104 Connection already in progress
107 Interrupted system call
116 Socket is already connected
122 Cannot access a needed shared library
125 Accessing a corrupted shared library
128 Cannot exec a shared library directly
131 Attempting to link in more shared libraries than system limit
134 <<.lib>> section in a.out corrupted
149 File or path name too long
152 Network interface not configured
155 Network is unreachable
158 Too many open files in system
164 No such file or directory
173 Virtual circuit is gone
179 No message of desired type
182 Machine is not on the network
188 Protocol not available
191 No space left on device
200 Function not implemented
203 Block device required
206 Socket is not connected
215 Socket operation on non-socket
221 Not a character device
224 No such device or address
236 Protocol wrong type for socket
248 Read-only file system
251 Can't send after socket shutdown
254 Socket type not supported
280 This function returns a pointer to a string. Your application must
281 not modify that string.
284 ANSI C requires <<strerror>>, but does not specify the strings used
285 for each error number.
287 Although this implementation of <<strerror>> is reentrant, ANSI C
288 declares that subsequent calls to <<strerror>> may overwrite the
289 result string; therefore portable code cannot depend on the reentrancy
292 This implementation of <<strerror>> provides for user-defined
293 extensibility. <<errno.h>> defines <[__ELASTERROR]>, which can be
294 used as a base for user-defined error values. If the user supplies a
295 routine named <<_user_strerror>>, and <[errnum]> passed to
296 <<strerror>> does not match any of the supported values,
297 <<_user_strerror>> is called with <[errnum]> as its argument.
299 <<_user_strerror>> takes one argument of type <[int]>, and returns a
300 character pointer. If <[errnum]> is unknown to <<_user_strerror>>,
301 <<_user_strerror>> returns <[NULL]>. The default <<_user_strerror>>
302 returns <[NULL]> for all input values.
304 <<strerror>> requires no supporting OS subroutines.
314 _DEFUN (strerror
, (errnum
),
318 extern char *_user_strerror
_PARAMS ((int));
322 /* go32 defines EPERM as EACCES */
323 #if defined (EPERM) && (!defined (EACCES) || (EPERM != EACCES))
330 error
= "No such file or directory";
335 error
= "No such process";
340 error
= "Interrupted system call";
348 /* go32 defines ENXIO as ENODEV */
349 #if defined (ENXIO) && (!defined (ENODEV) || (ENXIO != ENODEV))
351 error
= "No such device or address";
356 error
= "Arg list too long";
361 error
= "Exec format error";
366 error
= "Socket already connected";
371 error
= "Bad file number";
376 error
= "No children";
381 error
= "Destination address required";
386 error
= "No more processes";
391 error
= "Not enough space";
396 error
= "Permission denied";
401 error
= "Bad address";
406 error
= "Block device required";
411 error
= "Device or resource busy";
416 error
= "File exists";
421 error
= "Cross-device link";
426 error
= "No such device";
431 error
= "Not a directory";
436 error
= "Host is down";
441 error
= "Connection already in progress";
446 error
= "Is a directory";
451 error
= "Invalid argument";
456 error
= "Network interface is not configured";
461 error
= "Too many open files in system";
466 error
= "Too many open files";
471 error
= "Not a character device";
476 error
= "Text file busy";
481 error
= "File too large";
486 error
= "Host is unreachable";
491 error
= "No space left on device";
496 error
= "Not supported";
501 error
= "Illegal seek";
506 error
= "Read-only file system";
511 error
= "Too many links";
516 error
= "Broken pipe";
521 error
= "Math argument";
526 error
= "Result too large";
531 error
= "No message of desired type";
536 error
= "Identifier removed";
546 error
= "Network is unreachable";
556 error
= "Not a stream";
561 error
= "Stream ioctl timeout";
566 error
= "No stream resources";
571 error
= "Machine is not on the network";
576 error
= "No package";
581 error
= "Resource is remote";
586 error
= "Virtual circuit is gone";
591 error
= "Advertise error";
596 error
= "Srmount error";
601 error
= "Communication error";
606 error
= "Protocol error";
609 #ifdef EPROTONOSUPPORT
610 case EPROTONOSUPPORT
:
611 error
= "Unknown protocol";
616 error
= "Multihop attempted";
621 error
= "Bad message";
626 error
= "Cannot access a needed shared library";
631 error
= "Accessing a corrupted shared library";
636 error
= ".lib section in a.out corrupted";
641 error
= "Attempting to link in more shared libraries than system limit";
646 error
= "Cannot exec a shared library directly";
651 error
= "Function not implemented";
656 error
= "No more files";
661 error
= "Directory not empty";
666 error
= "File or path name too long";
671 error
= "Too many symbolic links";
676 error
= "No buffer space available";
681 error
= "Address family not supported by protocol family";
686 error
= "Protocol wrong type for socket";
691 error
= "Socket operation on non-socket";
696 error
= "Protocol not available";
701 error
= "Can't send after socket shutdown";
706 error
= "Connection refused";
711 error
= "Address already in use";
716 error
= "Software caused connection abort";
719 #if (defined(EWOULDBLOCK) && (!defined (EAGAIN) || (EWOULDBLOCK != EAGAIN)))
721 error
= "Operation would block";
726 error
= "Socket is not connected";
729 #ifdef ESOCKTNOSUPPORT
730 case ESOCKTNOSUPPORT
:
731 error
= "Socket type not supported";
736 error
= "Socket is already connected";
739 #if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (ENOTSUP != EOPNOTSUPP))
741 error
= "Operation not supported on socket";
746 error
= "Message too long";
751 error
= "Connection timed out";
755 if ((error
= _user_strerror (errnum
)) == 0)