httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Jones <JON...@er6s1.eng.ohio-state.edu>
Subject Re: checking for EWOULDBLOCK/EAGAIN *inside* APR
Date Mon, 10 Apr 2000 02:38:08 GMT
rbb@apache.org writes:
>I must really be missing something.  But, I'll try one more time.
>
>In Apache 1.3, in src/main/buff.c on line 718 among others, we check for
>errno != EAGAIN.  This works on every platform that 1.3 works on.  We are
>not checking for EWOULDBLOCK here.  Why can't we do the same thing for 2.0
>in APR?

I'm missing something too.  EAGAIN and EWOULDBLOCK to me mean different things:

   EAGAIN       Means a blocking system call was aborted because the process 
                caught a signal or some other failure.  You are supposed
                to decide if you still want to make the request (i.e. the
                signal wasn't requesting an abort) and try it again.

   EWOULDBLOCK  Means a non-blocking system call failed because of inadequate
                resources.  Wait for the resource to because available
                and then try again.

At some point, someone noticed that system calls can return one or the
other, but not both, so they equated them to the same value.  They are still
logically differently errors, with different recovery actions, so code that 
is doing I/O to a non-blocking socket should check for EWOULDBLOCK and not 
EAGAIN.

-------------------------------------------------------------------------------
David L. Jones               |      Phone:    (614) 292-6929
Ohio State University        |      Internet:
140 W. 19th St. Rm. 231a     |               jonesd@er6s1.eng.ohio-state.edu
Columbus, OH 43210           |               vman+@osu.edu

Mime
View raw message