cURL / Mailing Lists / curl-library / Single Mail


Curl_select() and Curl_poll() with CURL_ACKNOWLEDGE_EINTR

From: Yang Tse <>
Date: Thu, 22 Mar 2007 17:10:42 +0100

An experimental symbol definition check CURL_ACKNOWLEDGE_EINTR is now
done in Curl_select() and Curl_poll(). When compiled with
CURL_ACKNOWLEDGE_EINTR defined both functions will return as soon as a
signal is caught.

By default such definition is not made, so in order to test this,
CURL_ACKNOWLEDGE_EINTR will be needed to be defined manually.

All this is due to Bryan Henderson's initial idea and attempt to make
libcurl more interruptible.

In its current state, partial implementation, there is one part that
is missing to be able to use this with some confidence. All calls to
functions Curl_select() (18 times) and Curl_poll() (1 time) must be
revisited and checked to be conformant with the new possible
behaviour. And most likely some calls to Curl_pgrsUpdate(), which now
can be called nearly as often as desired, will also need to be added.

Anyone willing to help with this ? Bryan, still around or you jumped
off the boat ?

There's another thing which will influence the above work, and it is
the fact that I've not completely made up my mind of which is a better
choice in case that a signal is caught in Curl_select or Curl_poll.

A) As it is right now. Return -1 end errno set to EINTR if a signal is caught.

B) Second choice. Return 0 and errno cleared, if a signal is caught,
as if the timeout condition would have completed with no error at all
and no event would be available for the file descriptors involved.

Comments, ideas, something related ?

Received on 2007-03-22