lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4B1DC2B6.5080004@gmail.com>
Date:	Mon, 07 Dec 2009 21:06:30 -0600
From:	Robert Hancock <hancockrwd@...il.com>
To:	"Jacques, Hugo" <Hugo.Jacques@...int.com>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: Error in SEND(2) man page ?

On 12/07/2009 12:43 PM, Jacques, Hugo wrote:
>
> Hi,
>
> I think I found a discrepancy between the man page of send()and the actual implementation.
>
> Man page mentions that:
>
> "[...] When the message does not fit into the send buffer of the socket, send() normally blocks, unless the socket has been placed in non-blocking I/O mode. In non-blocking mode it would fail with the error EAGAIN or EWOULDBLOCK in this case.  [...]"
>
> This tells me that if doing a send() on a tcp non-blocking socket whose send buffer is full, the call should return with -1 and errno=EAGAIN.
>
> But running a trivial test app (code below), send() will indicate (return value) that is sent some but not all of the data buffer when the socket's send buffer is full.
>
> Am I missing anything?
> Is the man page or the code wrong?

I think the man page would be right for a datagram (ex: UDP) socket, but 
not for a stream (ex: TCP) socket, as a stream socket has no real 
concept of "messages".
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ