cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl and Mac OS X

From: Daniel Johnson <daniel_at_daniel-johnson.org>
Date: Tue, 30 Jan 2007 08:34:22 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Jan 28, 2007, at 11:02 PM, Yang Tse wrote:

> On Mon, 29 Jan 2007, Daniel Johnson wrote:
>
>> I've noticed a couple of things during my builds. One is that tests
>> 518 and 537 always fail, and apparently always have failed on OS X.
>> It's probably due to the need to use select instead of poll. Perhaps
>> those tests should be disabled on OS X?
>
> Your own submitted autobuild log shows: "checking if we are Mac OS X
> (to disable poll)... yes". So it is clear that libcurl & curl have
> been built using the working select() instead of the poll() function.
> If built with a non reliable poll(), then other test cases would also
> be failing besides 518 and 537.
>
> I don't agree with disabling tests 518 and 537 on OS X.
>
> In this specific case Its failure is indicating that in case that more
> than FD_SETSIZE file descriptors, or sockets, are open libcurl or any
> other program using select() won't be able to use a new connection.
>
> The difference between libcurl and many other third party programs is
> that when the above condition is met libcurl will behave properly and
> won't actually perform the call to select(), since this could trigger
> quite nasty effects.
>
> Gory details about FD_SETSIZE and select() at
> http://developer.apple.com/documentation/Darwin/Reference/Manpages/
> man5/types.5.html
> and http://developer.apple.com/documentation/Darwin/Reference/
> Manpages/man2/select.2.html
>
> Maybe these tests could be 'enhanced' when using select() instead of
> poll(). Maybe even tests in configure script for a working select()
> with more than FD_SETSIZE fds...
>
> Anyway. Could you test if Mac OS X 10.4.8 implementation of poll() is
> fine ? Edit configure.ac, replace single appearance of
> disable_poll="yes"; with disable_poll="no"; rerun buildconf, configure
> , make, and tests
>
> Maybe current implementation of poll() is OK.

OK, I've looked into this more closely. On 10.4.x, poll() is known
not to work with devices. This is documented in the man page. I don't
know enough to say if that's a problem for libcurl, but if libcurl
DOESN'T call poll on devices then it should be safe to use.

I disabled the configure test "checking if we are Mac OS X (to
disable poll)..." and built libcurl with poll enabled. All tests
passed including 518 and 537. Please let me know if there's anything
else I can do to test.

Daniel

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)
Comment: http://homepage.mac.com/danielj7/publickey.txt

iD8DBQFFv0le4sDFGYouOqARAhr3AJ48jbqO4vYlziXCOaHstBI36CXwdACgkMvy
7FCV2VfmIX+pN8AOAR3wLhw=
=Kxo6
-----END PGP SIGNATURE-----
Received on 2007-01-30