Re: Lack of Documentation about SA_RESTART...

From: Paolo Ornati
Date: Wed Jul 13 2005 - 02:48:19 EST


On Tue, 12 Jul 2005 14:16:35 -0400
Theodore Ts'o <tytso@xxxxxxx> wrote:

> Yes, do look at that. From the latest 2.6 sources:
>
> timeo = sock_sndtimeo(sk, flags & O_NONBLOCK);
>
> if ((1 << sk->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV)) {
> /* Error code is set above */
> if (!timeo || !inet_wait_for_connect(sk, timeo))
> goto out;
>
> err = sock_intr_errno(timeo);
> if (signal_pending(current))
> goto out;
> }
>
> If the socket is non-blocking, then we don't call
> inet_wiat_for_connect(), yes. But sock_intr_errno() will set the
> error code to -EINTR if the socket is set to non-nonblocking (see
> include/net/sock.h), and if a signal is pending, return it.

No.

With non-blocking socket "timeo" is set to 0. So the instruction:

if (!timeo || !inet_wait_for_connect(sk, timeo))
goto out;

jumps directly to "out" label. "sock_intr_errno()" isn't called.

--
Paolo Ornati
Linux 2.6.12.2 on x86_64
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/