[ic] EINTR on select

Javier Martin interchange-users@interchange.redhat.com
Mon Dec 10 06:00:01 2001


Steffen,

> > > > My question is: Is it possible that the interchange process
> > > > receive any
> > > > asynchronous signal that could break ongoing system calls such
> > > > as select?

> You should call select(2) in a
> do {} while (ret == 1 && errno == EINTR);
> BTW, since you cannot rely on select return value for tm on most
> systems, you need to use gettimeofday() or something which makes
> a correct time select code slightly more complex... Same of
> course for reads and writes. Well, and since things like print

Hmmm! I've noticed the 'do {} while EINTR' being a quite common practice in
a lot of similar situations. I've wrapped the offending select in the
libwww-perl code and it has been working happily for two days. Thank you
very much!  I have also submitted a bug report to the libwww-perl's bugtrack
at sf.net, I don't know if they will include on new releases but I hope
so...

Javier