Re: Possible Manpage bug for bind(2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ryan,

On 07/17/2014 07:39 PM, Ryan Hammonds wrote:
> Greetings,
> I'd like to point out an issue in the manpage for bind(2). My
> application is trying to bind an IPV4 UDP socket to an address. I've
> found that passing an invalid address length to bind() causes bind to
> return EINVAL. According to the bind(2) manpage, this should only
> occur when using unix domain sockets (which I am not). 

Yes, your report looks right to me. I applied the patch below.
Thanks for the report.


> This also
> makes me wonder if the current description (EINVAL = "the socket is
> already bound to an address") is correct in the first place.

A bit of light testing suggests that it is (still) correct.

Cheers,

Michael

--- a/man2/bind.2
+++ b/man2/bind.2
@@ -183,6 +183,12 @@ The socket is already bound to an address.
 .\" This may change in the future: see
 .\" .I linux/unix/sock.c for details.
 .TP
+.B EINVAL
+.I addrlen
+is wrong, or
+.I addr
+is not a valid address for this socket's domain.
+.TP
 .B ENOTSOCK
 .I sockfd
 is a descriptor for a file, not a socket.
@@ -204,13 +210,6 @@ address was not local.
 .I addr
 points outside the user's accessible address space.
 .TP
-.B EINVAL
-The
-.I addrlen
-is wrong, or the socket was not in the
-.B AF_UNIX
-family.
-.TP
 .B ELOOP
 Too many symbolic links were encountered in resolving
 .IR addr .

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux