state-threads
[Top] [All Lists]

Re: strange code

To: Lev Walkin <vlm@xxxxxxxxx>, state-threads@xxxxxxxxxxx
Subject: Re: strange code
From: Gene Shekhtman <gsh@xxxxxxxxxx>
Date: Thu, 25 Oct 2001 16:51:22 -0700
Organization: Abeona Networks, Inc.
References: <200110251417.f9PEHo308203@spelio.netli.lan> <3BD89DF2.60294384@abeona.com>
Sender: owner-state-threads@xxxxxxxxxxx
Gene Shekhtman wrote:

> >
> > Can anybody explain the hidden meaning of
> >
> >         err = 1
> >
> > string?
> >
>
> Some platforms (e.g., IRIX 6.2, fixed in 6.5) have "peculiar"
> implementation of connect(2).  On those platforms if connect(2) is
> interrupted (errno == EINTR) after socket was bound by the kernel,
> the second connect(2) attempt will fail with errno == EADDRINUSE.
>
> The code above ignores EADDRINUSE iff connect(2) was previously
> interrupted (the err flag was set).
>
> --Gene

I just found more details in the Rich Stevens' "UNIX Network Programming",
Vol.1, 2nd edition, p. 413 ("Interrupted connect").




<Prev in Thread] Current Thread [Next in Thread>