[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] missing EINTR handling?



On Tue, 2009-10-27 at 09:53 -0400, Pierre Phaneuf wrote:
> Looking at the evhttp_write() callback handler (in http.c), I see a
> call to evbuffer_write() at line 685, which in turns calls write() (at
> line 413 of buffer.c), and neither seems to handle EINTR. I see EINTR
> handling in evhttp_read(), though. Simple omission?
> 
> I also wonder why EINTR isn't handled at the evbuffer level, say,
> since there is pretty much nothing else to do than retry it
> immediately, isn't it? As opposed to EAGAIN, say, which requires
> retrying it at a later time, when another event comes in...

Actually, EINTR can be useful for moving signal handling back into the
normal flow of a program.  EINTR tells you that one happened so you can
go back to the main event loop and dispatch the signal handler if need
be.

I don't know that libevent does this, but that's what I think EINTR is
useful for.

Have fun (if at all possible),
-- 
A word is nothing more or less than the series of historical
connotations given to it. That's HOW we derive meaning, and to claim
that there is an arbitrary meaning of words above and beyond the way
people use them is a blatant misunderstanding of the nature of language.
-- Anonymous blogger
-- Eric Hopper (hopper@xxxxxxxxxxxxxxx http://www.omnifarious.org/~hopper)--

Attachment: signature.asc
Description: This is a digitally signed message part