public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Hancock <hancockrwd@gmail.com>
To: "Jacques, Hugo" <Hugo.Jacques@verint.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Error in SEND(2) man page ?
Date: Mon, 07 Dec 2009 21:06:30 -0600	[thread overview]
Message-ID: <4B1DC2B6.5080004@gmail.com> (raw)
In-Reply-To: <579B119545DAEF4689C8FBEEFEC5793F01FA2F6FC6C8@ATLMBX.verint.corp.verintsystems.com>

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".

      reply	other threads:[~2009-12-08  3:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-07 18:43 Error in SEND(2) man page ? Jacques, Hugo
2009-12-08  3:06 ` Robert Hancock [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B1DC2B6.5080004@gmail.com \
    --to=hancockrwd@gmail.com \
    --cc=Hugo.Jacques@verint.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox