Subject: bind and O_NONBLOCK

From: Ulrich Drepper <[email-masked]>
Date: Thu, 20 Sep 2007 22:59:53 -0700

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.

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖