The man pages were rather inconsistent in the use of "Unix"
versus "UNIX". Let's go with the trademark usage.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "non-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
in POSIX or C99
Hello Kurt,
Thanks for your message.
> man3/errno.3 was missing some errors.
Indeed.
> This patch updates errno.3 based
> on /usr/include/linux/errno.h as of 2.6.16-rc2.
I do not quite understand that last: /usr/include/linux/errno.h is a
userland file -- it probably won't tie up too well to a
specific kernel version (or am I missing something?).
> I also synced the error
> description in the man page with the error descriptions from the header
> file.
This generates some useful info, but also some things that are incorrect.
For example, since you are talking about a glibc header, does a
particular error even occur on Linux. (See some examples below.)
I think you also overlooked the fact that the page says that the listed
errors are defined by POSIX.1-2001. So it is not sufficient to just
add new errors to the list. On the other hand, it is irritating
that the current page does not list Linux-specific errors.
And you patch has finally pushed me to do something I've been
thinking of for a while. So I've changed the page to mark the
errors that are POSIX, and added the Linux-specifc errors,
integrating some of your patch.
> The patch was diffed against manpages-2.22.
Thanks -- many people forget to mention that detail.
> --- errno.3.orig 2005-12-14 07:09:39.000000000 -0500
> +++ errno.3 2006-02-06 23:45:52.000000000 -0500
> @@ -23,9 +23,11 @@
> .\" 5 Oct 2002, Modified by Michael Kerrisk <mtk-manpages@gmx.net>
> .\" Updated for POSIX 1003.1 2001
> .\" 2004-12-17 Martin Schulze <joey@infodrom.org>, mtk
> -.\" Removed errno declaration prototype, added notes
> +.\" Removed errno declaration prototype, added notes
> +.\" 7 Feb 2006, Modified by Kurt Wall <kwall@kurtwerks.com>
> +.\" Add missing errors, sync to linux-2.6.16-rc2
> .\"
> -.TH ERRNO 3 2004-12-17 "" "Library functions"
> +.TH ERRNO 3 2006-02-07 "" "Library functions"
> .SH NAME
> errno \- number of last error
> .SH SYNOPSIS
> @@ -71,61 +73,95 @@
> .\" FIXME The following list is far from complete
> .TP
> .B E2BIG
> -Arg list too long
> +Argument list too long
ok
> .TP
> .B EACCES
> Permission denied
> .TP
> .B EADDRINUSE
> -Address in use
> +Address already in use
ok
> .TP
> .B EADDRNOTAVAIL
> -Address not available
> +Cannot assign requested address
ok
> +.TP
> +.B EADV
> +Advertise error
This is a HURD error. As far as I can tell it does not occur on Linux.
> .TP
> .B EAFNOSUPPORT
> -Address family not supported
> +Address family not supported by protocol
POSIX differs. I stayed with POSIX.
> .TP
> .B EAGAIN
> -Resource temporarily unavailable
> +Try again
This is wrong. (i.e., it does not match POSIX and/or
what perror(3) produces)
> .TP
> .B EALREADY
> -Connection already in progress
> +Operation already in progress
POSIX differs. I stayed with POSIX.
> +.TP
> +.B EBADE
> +Invalid exchange
ok
> .TP
> .B EBADF
> -Bad file descriptor
> +Bad file number
This is wrong.
> +.TP
> +.B EBADFD
> +File descriptor in bad state
ok
> .TP
> .B EBADMSG
> -Bad message
> +Not a data message
This is wrong.
> +.TP
> +.B EBADR
> +Invalid request descriptor
ok
> +.TP
> +.B EBADRQC
> +Invalid request code
ok
> +.TP
> +.B EBADSLT
> +Invalid slot
ok
> +.TP
> +.B EBFONT
> +Bad font file format
As far as I can tell, this is not used on Linux. Let me know
if you find otherwise. (I didn't add it)
> .TP
> .B EBUSY
> -Resource busy
> +Device or resource busy
ok
> .TP
> .B ECANCELED
> -Operation canceled
> +Operation Canceled
Please review the output of automated scripts!
(not changed)
> .TP
> .B ECHILD
> No child processes
> .TP
> +.B ECHRNG
> +Channel number out of range
ok
> +.TP
> +.B ECOMM
> +Communication error on send
ok
> +.TP
> .B ECONNABORTED
> -Connection aborted
> +Software caused connection abort
POSIX differs. I stayed with POSIX.
> .TP
> .B ECONNREFUSED
> Connection refused
> .TP
> .B ECONNRESET
> -Connection reset
> +Connection reset by peer
POSIX differs. I stayed with POSIX.
> .TP
> .B EDEADLK
> -Resource deadlock avoided
> +Resource deadlock would occur
POSIX differs. I stayed with POSIX.
> +.TP
> +.B EDEADLOCK
> +Resource deadlock would occur (might be the same value as
> +.BR EDEADLK)
I wrote just "Synonym for EDEADLK"
> .TP
> .B EDESTADDRREQ
> Destination address required
> .TP
> .B EDOM
> -Domain error
> +Math argument out of domain of func
? Garbled
I wrote the POSIX defn: Mathematics argument out of domain of function
> +.TP
> +.B EDOTDOT
> +RFS specific error
This is defined, but appears not to be used.
(I didn't add it)
> .TP
> .B EDQUOT
> -Reserved
> +Quota exceeded
POSIX says "Reserved." In this case better to go with
"Disk quota exceeded"
> .TP
> .B EEXIST
> File exists
> @@ -136,8 +172,11 @@
> .B EFBIG
> File too large
> .TP
> +.B EHOSTDOWN
> +Host is down
ok
> +.TP
> .B EHOSTUNREACH
> -Host is unreachable
> +No route to host
POSIX differs. I stayed with POSIX.
> .TP
> .B EIDRM
> Identifier removed
> @@ -146,25 +185,70 @@
> Illegal byte sequence
> .TP
> .B EINPROGRESS
> -Operation in progress
> +Operation now in progress
POSIX differs. I stayed with POSIX.
> .TP
> .B EINTR
> -Interrupted function call
> +Interrupted system call
POSIX differs. I stayed with POSIX.
> .TP
> .B EINVAL
> Invalid argument
> .TP
> .B EIO
> -Input/output error
> +I/O error
POSIX differs. I stayed with POSIX.
> .TP
> .B EISCONN
> -Socket is connected
> +Transport endpoint is already connected
POSIX differs. I stayed with POSIX.
> .TP
> .B EISDIR
> Is a directory
> .TP
> +.B EISNAM
> +Is a named type file
ok
> +.TP
> +.B EKEYEXPIRED
> +Key has expired
ok
> +.TP
> +.B EKEYREJECTED
> +Key was rejected by service
ok
> +.TP
> +.B EKEYREVOKED
> +Key has been revoked
ok
> +.TP
> +.B EL2HLT
> +Level 2 halted
ok
> +.TP
> +.B EL2NSYNC
> +Level 2 not synchronized
ok
> +.TP
> +.B EL3HLT
> +Level 3 halted
ok
> +.TP
> +.B EL3RST
> +Level 3 reset
ok
> +.TP
> +.B ELIBACC
> +Can not access a needed shared library
ok
> +.TP
> +.B ELIBBAD
> +Accessing a corrupted shared library
ok
> +.TP
> +.B ELIBEXEC
> +Cannot exec a shared library directly
ok
> +.TP
> +.B ELIBMAX
> +Attempting to link in too many shared libraries
ok
> +.TP
> +.B ELIBSCN
> +.lib section in a.out corrupted
ok
> +.TP
> +.B ELNRNG
> +Link number out of range
This is defined, but appears not to be used.
(I didn't add it)
> +.TP
> .B ELOOP
> -Too many levels of symbolic links
> +Too many symbolic links encountered
this is wrong
> +.TP
> +.B EMEDIUMTYPE
> +Wrong medium type
> .TP
> .B EMFILE
> Too many open files
> @@ -173,32 +257,41 @@
> Too many links
> .TP
> .B EMSGSIZE
> -Inappropriate message buffer length
> +Message too long
ok
> .TP
> .B EMULTIHOP
> -Reserved
> +Multihop attempted
ok
POSIX says "Reserved." In this case better to go with
Linux.
> .TP
> .B ENAMETOOLONG
> -Filename too long
> +File name too long
Scripted output?
(no change)
> +.TP
> +.B ENAVAIL
> +No XENIX semaphores available
This is defined, but appears not to be used.
(I didn't add it)
> .TP
> .B ENETDOWN
> Network is down
> .TP
> .B ENETRESET
> -Connection aborted by network
> +Network dropped connection because of reset
POSIX differs. I stayed with POSIX.
> .TP
> .B ENETUNREACH
> -Network unreachable
> +Network is unreachable
POSIX differs. I stayed with POSIX.
> .TP
> .B ENFILE
> -Too many open files in system
> +File table overflow
This is wrong
> +.TP
> +.B ENOANO
> +No anode
This is defined, but appears not to be used.
(I didn't add it)
> .TP
> .B ENOBUFS
> No buffer space available
> +.TP
> +.B ENOCSI
> +No CSI structure available
This is defined, but appears not to be used.
(I didn't add it)
> .\" ENODATA is part of XSR option
> .TP
> .B ENODATA
> -No message is available on the STREAM head read queue
> +No data available
POSIX differs. I stayed with POSIX.
> .TP
> .B ENODEV
> No such device
> @@ -209,17 +302,29 @@
> .B ENOEXEC
> Exec format error
> .TP
> +.B ENOKEY
> +Required key not available
ok
> +.TP
> .B ENOLCK
> -No locks available
> +No record locks available
This is wrong
> .TP
> .B ENOLINK
> -Reserved
> +Link has been severed
ok
POSIX says "Reserved." In this case better to go with
Linux.
> +.TP
> +.B ENOMEDIUM
> +No medium found
ok
> .TP
> .B ENOMEM
> -Not enough space
> +Out of memory
POSIX differs. I stayed with POSIX.
> .TP
> .B ENOMSG
> -No message of the desired type
> +No message of desired type
POSIX differs. I stayed with POSIX.
> +.TP
> +.B ENONET
> +Machine is not on the network
ok
> +.TP
> +.B ENOPKG
> +Package not installed
ok
> .TP
> .B ENOPROTOOPT
> Protocol not available
> @@ -229,17 +334,20 @@
> .\" ENOSR is part of XSR option
> .TP
> .B ENOSR
> -No STREAM resources
> +Out of streams resources
POSIX differs. I stayed with POSIX.
> .\" ENOSTR is part of XSR option
> .TP
> .B ENOSTR
> -Not a STREAM
> +Device not a stream
POSIX differs. I stayed with POSIX.
> .TP
> .B ENOSYS
> Function not implemented
> .TP
> +.B ENOTBLK
> +Block device required
> +.TP
ok
> .B ENOTCONN
> -The socket is not connected
> +Transport endpoint is not connected
POSIX differs. I stayed with POSIX.
> .TP
> .B ENOTDIR
> Not a directory
> @@ -247,27 +355,33 @@
> .B ENOTEMPTY
> Directory not empty
> .TP
> -.B ENOTSOCK
> -Not a socket
> +.B ENOTNAM
> +Not a XENIX named type file
This is defined, but appears not to be used.
(I didn't add it)
> .TP
> -.B ENOTSUP
> -Not supported
No! This exists.
> +.B ENOTSOCK
> +Socket operation on non-socket
> .TP
> .B ENOTTY
> -Inappropriate I/O control operation
> +Not a typewriter
this is wrong
> +.TP
> +.B ENOTUNIQ
> +Name not unique on network
ok
> .TP
> .B ENXIO
> No such device or address
> .TP
> .B EOPNOTSUPP
> -Operation not supported on socket
> +Operation not supported on transport endpoint
POSIX differs. I stayed with POSIX.
(In passing ENOTSUP and EOPNOTSUPP have the same value on Linux;
POSIX.1 does not permit this.)
> .TP
> .B EOVERFLOW
> -Value too large to be stored in data type
> +Value too large for defined data type
POSIX differs. I stayed with POSIX.
> .TP
> .B EPERM
> Operation not permitted
> .TP
> +.B EPFNOSUPPORT
> +Protocol family not supported
ok
> +.TP
> .B EPIPE
> Broken pipe
> .TP
> @@ -281,39 +395,76 @@
> Protocol wrong type for socket
> .TP
> .B ERANGE
> -Result too large
> +Math result not representable
POSIX differs. I stayed with POSIX.
> +.TP
> +.B EREMCHG
> +Remote address changed
ok
> +.TP
> +.B EREMOTE
> +Object is remote
ok
> +.TP
> +.B EREMOTEIO
> +Remote I/O error
ok
> +.TP
> +.B ERESTART
> +Interrupted system call should be restarted
ok
> .TP
> .B EROFS
> Read-only file system
> .TP
> +.B ESHUTDOWN
> +Cannot send after transport endpoint shutdown
ok
> +.TP
> +.B ESOCKTNOSUPPORT
> +Socket type not supported
ok
> +.TP
> .B ESPIPE
> -Invalid seek
> +Illegal seek
POSIX differs. I stayed with POSIX.
> .TP
> .B ESRCH
> No such process
> .TP
> +.B ESRMNT
> +Srmount error
This is defined, but appears not to be used.
(I didn't add it)
> +.TP
> .B ESTALE
> -Stale file handle
> +Stale NFS file handle
Tricky -- you are right about the error message,
but the message itself is wrong, because the error
can occur on other file sytems also.
(not changed)
> .\" Can occur for NFS and for other file systems
> .\" ETIME is part of XSR option
> .TP
> +.B ESTRPIPE
> +Streams pipe error
ok
> +.TP
> .B ETIME
> -STREAM
> -.BR ioctl ()
> -timeout
> +Timer expired
POSIX differs, but Linux doesn't have streams, and the error is
used for various purposes. Changed as you proposed.
> .TP
> .B ETIMEDOUT
> -Operation timed out
> +Connection timed out
ok
> +.TP
> +.B ETOOMANYREFS
> +Too many references: cannot splice
This is defined, but appears not to be used.
(I didn't add it)
> .TP
> .B ETXTBSY
> Text file busy
> .TP
> -.B EWOULDBLOCK
> -Operation would block (may be same value as
> -.BR EAGAIN )
Absolutely not!!
> +.B EUCLEAN
> +Structure needs cleaning
ok
> +.TP
> +.B EUNATCH
> +Protocol driver not attached
ok
> +.TP
> +.B EUSERS
> +Too many users
ok
> +.TP
> +.B EWOULDBLOCK
> +Operation would block (might be same value as
> +.BR EAGAIN)
okay (except formatting was not quite right: .BR EAGAIN )
> .TP
> .B EXDEV
> -Improper link
> +Cross-device link
> +.TP
> +.B EXFULL
> +Exchange full
ok