On Tue, 14 Jan 2003, Martin Blapp wrote:

>
> Hi Thomas,
>
> >     s = splnet();
> > +   if (so->so_state & (SS_ISCONNECTED | SS_ISCONNECTING)) {
> > +           splx(s);
> > +           return (EINVAL);
> > +   }
> >     error = (*so->so_proto->pr_usrreqs->pru_listen)(so, td);
> >     if (error) {
> >             splx(s);
> >
>
> Can you commit this ? The fix looks appropriate, but the manpage should
> also be changed to reflect the change.
>
> ERRORS
>      Listen() will fail if:
>
>      [EBADF]            The argument s is not a valid descriptor.
>      [ENOTSOCK]         The argument s is not a socket.
>      [EOPNOTSUPP]       The socket is not of a type that
>                       supports the operation listen().
>      [EINVAL]         Listen() has been already called on the socket.
>
> Any objections from others ?

EINVAL is a bogus errno for this, but is standard.  POSIX has better
wording: "The socket is already connected".  The patch also returns
EINVAL if the socket is being connected.  Is this right?  (Maybe we
should wait until we can tell if it is connected.)

POSIX also specifies the errors EDESTADDRREQ, EACCES, another EINVAL for
shut down sockets, and ENOBUFS.  The last 3 "may" cause listen() to fail
and the others (including the first EINVAL) "shall" cause it to fail.

Bruce


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to