[ECOS] Re: What causes interrupted network system calls?

Grant Edwards grant.b.edwards@gmail.com
Wed Oct 28 18:40:00 GMT 2009

On 2009-10-28, Nick Garnett <nickg@ecoscentric.com> wrote:
>  Grant Edwards <grant.b.edwards@gmail.com> writes:
>> On 2009-10-28, Nick Garnett <nickg@ecoscentric.com> wrote:
>>>  Grant Edwards <grant.b.edwards@gmail.com> writes:
>>>>  1) in the same situation we never saw EINTR with the previous
>>>>     network stack.
>>> It is probable that the OpenBSD stack totally ignored signals
>>> and therefore wouldn't necessarily do the right thing. The
>>> FreeBSD stack is better integrated with POSIX support.
>> We're not using POSIX support.
> In which case there is something else going on. The only place
> that the FreeBSD stack generates an EINTR result is in
> cyg_tsleep() when the call to cyg_semaphore_timed_wait()
> returns false, and it is not a timeout.

Yep, that's the only place I could find.

> Something must either be zapping that semaphore in some way,
> or the thread is being released by something else. The OpenBSD
> stack has similar code, so it is not immediately clear why one
> stack is doing this and the other not.
> Are you sure that the EINTR result is coming from the stack
> itself and is not simply a leftover in errno from a previous
> call? Try zeroing errno before the call.

We'll try that.

> Also, in the original message you mentioned -EINTR.
> While negative error codes are returned from some drivers,
> network drivers don't do this. Negative driver error codes are
> also negated before being put into errno.
> So, I don't know where -EINTR is coming from, but it should
> never find its way into errno. I think your best approach is
> to track down where this error code is actually coming from.

I may have misunderstood the description of the send()
return/errno values.  I'll double-check that.

Grant Edwards                   grante             Yow! Oh my GOD -- the
                                  at               SUN just fell into YANKEE
                               visi.com            STADIUM!!

Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list