All of lore.kernel.org
 help / color / mirror / Atom feed
From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: Ulrich Drepper <drepper@redhat.com>
Cc: netdev <netdev@vger.kernel.org>, Alan Cox <alan@redhat.com>
Subject: Re: bind and O_NONBLOCK
Date: Sat, 22 Sep 2007 20:14:15 +0400	[thread overview]
Message-ID: <20070922161414.GA29637@2ka.mipt.ru> (raw)
In-Reply-To: <46F35DD9.4000909@redhat.com>

Hi Ulrich.

On Thu, Sep 20, 2007 at 10:59:53PM -0700, Ulrich Drepper (drepper@redhat.com) wrote:
> Some time back Alan asked about adding O_NONBLOCK support to bind in the
> POSIX spec.  I brought this up and the following text will be in the
> next revision of the POSIX spec:
> 
> =======================
> If the socket address cannot be assigned immediately and O_NONBLOCK is
> set for the file descriptor for the socket, bind( ) shall fail and set
> errno to [EINPROGRESS], but the assignment request shall not be aborted,
> and the assignment shall be completed asynchronously. Subsequent calls
> to bind() for the same socket, before the assignment is completed, shall
> fail and set errno to [EALREADY].
> 
> When the assignment has been performed asynchronously, pselect(),
> select(), and poll() shall indicate that the file descriptor for the
> socket is ready for reading and writing.
> =======================
> 
> It would be ideal if we'd have such an implementation in the next few
> months so that we, in theory, can check whether the text in the
> specification makes sense.

On behalf of which process this is supposed to be done?
Network does not have any async processing units to perform this kind 
of operations. There are four ways where bind can fail:

1. unsufficient rights - nothing can help here
2. there is no memory - async binding can not help here too, since it
	some memory just has to be allocated to save async request
	somewhere.
3. socket is locked.
4. addres is being bound is in use.

We can wait until it is released and perform binding on behalf of some 
other process in both situations, although I think we do not want 4'th
variant in some cases.

So, did I understand you correctly, that you want to introduce network
AIO here? (for example on behalf of work queue or something else?)

-- 
	Evgeniy Polyakov

  reply	other threads:[~2007-09-22 16:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-21  5:59 bind and O_NONBLOCK Ulrich Drepper
2007-09-22 16:14 ` Evgeniy Polyakov [this message]
2007-09-22 16:21   ` Ulrich Drepper
2007-09-22 16:59     ` Evgeniy Polyakov
2007-09-22 17:11       ` Ulrich Drepper
2007-09-22 17:19         ` Evgeniy Polyakov
2007-09-23  5:58         ` David Miller
2007-09-23 20:43           ` Alan Cox
2007-09-22 17:35   ` Alan Cox
2007-09-22 17:40     ` Evgeniy Polyakov
2007-09-28 22:56 ` David Miller

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=20070922161414.GA29637@2ka.mipt.ru \
    --to=johnpol@2ka.mipt.ru \
    --cc=alan@redhat.com \
    --cc=drepper@redhat.com \
    --cc=netdev@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 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.