public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Pelly <npelly@google.com>
To: Iain Hibbert <plunky@rya-online.net>
Cc: linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org,
	davem@davemloft.net, Marcel Holtmann <marcel@holtmann.org>
Subject: Re: Expected behavior of shutdown() in multi-threaded socket programming
Date: Mon, 15 Jun 2009 14:20:43 -0700	[thread overview]
Message-ID: <35c90d960906151420l1805b5f6j78d4a8172874104e@mail.gmail.com> (raw)
In-Reply-To: <1244796365.448636.603.nullmailer@galant.ukfsn.org>

On Fri, Jun 12, 2009 at 1:46 AM, Iain Hibbert<plunky@rya-online.net> wrote:
> On Thu, 11 Jun 2009, Nick Pelly wrote:
>
>> Any comments on this one? I would like to correct the behavior of
>> shutdown() on AF_BLUETOOTH sockets, but I have been advised by Marcel
>> Holtmann that we need to agree on the correct behavior first.
>>
>> How should shutdown() behave when other threads are blocked on the same =
socket?
>
> IMHO consistency should apply.
>
> The opengroup specification for shutdown() says
>
> =A0"The shutdown() function shall cause all or part of a full-duplex
> =A0connection on the socket associated with the file descriptor socket to
> =A0be shut down."
>
> and while that does not really cover the case when the socket is blocked
> in accept(), if all the other socket types abort the block then that is
> what the PF_BLUETOOTH sockets should do too.
>
> The opengroup specification for accept() suggests EINVAL would be returne=
d
> if the socket was not accepting connections and arguably that is the case
> after a shutdown(), though ECONNABORTED could be used too (your program
> displays ECONNABORTED on NetBSD for instance)
>
>> I also have similar results for other blocking syscalls such as
>> connect(), read(), write(), poll() etc, but the test program is not as
>> simple.
>
> They should all handle the shutdown().

Sounds good to me.

Thanks for the input.

Nick

      reply	other threads:[~2009-06-15 21:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-19 21:29 Expected behavior of shutdown() in multi-threaded socket programming Nick Pelly
2009-06-12  0:24 ` Nick Pelly
2009-06-12  8:46   ` Iain Hibbert
2009-06-15 21:20     ` Nick Pelly [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=35c90d960906151420l1805b5f6j78d4a8172874104e@mail.gmail.com \
    --to=npelly@google.com \
    --cc=davem@davemloft.net \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=netdev@vger.kernel.org \
    --cc=plunky@rya-online.net \
    /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