This patch documents the order of the getaddrinfo(3) results
(RFC 3484), how should the application deal with that,
mentions the extremely common cause of having multiple
results per query (both IPv4 and IPv6 addresses available)
and mentions /etc/gai.conf.
(mtk: Minor tweaks, and note glibc version for /etc/gai.conf)
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
If an exit handler itself calls exit(3), the results are
undefined (see the POSIX.1-2001 specification of exit(3)).
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
According to POSIX.1, using longjmp() to terminate execution of
a function registered using atexit() produces undefined results.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
According to POSIX.1, using longjmp() to terminate execution of
a function registered using atexit() produces undefined results.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
It's a subtle point, but if a registered function itself
calls exit(3), then subsequent functions that were registered
with on_exit(3) will see the exit status given to the more
recent exit(3) call.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
When a 32-bit app opens a file whose size is too big to be
represented in 31-bits, POSIX.1 specifies the error EOVERFLOW.
Linux used to give EFBIG for this case, but 2.6.24 fixed this.
Also, add some text to describe the error scenario in
more detail.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Some errors were listed under a separate "may" heading.
There's probably no real need to do this; integrate
those errors into the main list.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Most other sockets pages are using the names 'addr'
and 'addrlen'; make these pages do the same.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
If the recvfrom() returned address is truncated, the 'fromlen'
argument indicates the actual size of the address, rather than
a count of the number of bytes in the truncated buffer.
Also clarify that the 'from' argument can be NULL, in which
case 'fromlen' should is unused, and should also be NULL.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
If the returned address is truncated, the 'addrlen' argument
indicates the actual size of the address, rather than a count
of the number of bytes in the truncated buffer.
Also clarify that if 'addr' argument is NULL, then 'addrlen'
should is unused, and should also be NULL.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Many sockets man pages use the name 'sockfd' already.
For consistency, changes the others to do so as well.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>