All of lore.kernel.org
 help / color / mirror / Atom feed
From: bert hubert <ahu@ds9a.nl>
To: Miquel van Smoorenburg <miquels@cistron.nl>
Cc: linux-kernel@vger.kernel.org
Subject: Re: TCP hangs in 2.4 - blocking write() in wait_for_tcp_memory
Date: Wed, 30 Oct 2002 13:28:12 +0100	[thread overview]
Message-ID: <20021030122812.GA5182@outpost.ds9a.nl> (raw)
In-Reply-To: <apod64$sv5$1@ncc1701.cistron.net>

On Wed, Oct 30, 2002 at 10:44:20AM +0000, Miquel van Smoorenburg wrote:

> This makes both socket programs hang in write(), in wait_for_tcp_memory.
> Shouldn't the kernel return a short write, instead of hanging
> both processes ? select() returned writeability.

write(2) is allowed to do a short write on a blocking socket, but not
mandated to do so. In fact I've only seen short writes under
linux on non-blocking sockets.

SuSv3 says:

 Blocking/immediate: Blocking is only possible with O_NONBLOCK clear. If
 there is enough space for all the data requested to be written immediately,
 the implementation should do so. Otherwise, the process may block; that is,
 pause until enough space is available for writing. The effective size of a
 pipe or FIFO (the maximum amount that can be written in one operation
 without blocking) may vary dynamically, depending on the implementation, so
 it is not possible to specify a fixed value for it.

...

 Partial and deferred writes are only possible with O_NONBLOCK set.

Regards,

bert

-- 
http://www.PowerDNS.com          Versatile DNS Software & Services
http://lartc.org           Linux Advanced Routing & Traffic Control HOWTO

  reply	other threads:[~2002-10-30 12:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-29 16:51 TCP hangs in 2.4.20-pre11 (and 2.4.19) Miquel van Smoorenburg
2002-10-30 10:44 ` TCP hangs in 2.4 - blocking write() in wait_for_tcp_memory Miquel van Smoorenburg
2002-10-30 12:28   ` bert hubert [this message]
2002-10-30 12:44     ` Miquel van Smoorenburg

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=20021030122812.GA5182@outpost.ds9a.nl \
    --to=ahu@ds9a.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miquels@cistron.nl \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.