Menu

#887 Include <sys/select.h> on older FreeBSD versions

closed-fixed
5
2013-06-21
2009-12-18
No

This is not a problem with the curl/libcurl build per se, but rather with programs that use it. In include/curl/multi.h, there is a function prototype that uses the fd_set type, which ought to be declared in <sys/select.h>. If a curl consumer has forgotten to include <sys/types.h> and <sys/select.h>, as xmlrpc-c does, a simple #include <curl.h> would be enough to break the compilation.

Of course, this could be construed as a problem in curl consumers - if you use network sockets, use the network API :) However, there are programs that have no obvious need for the <sys/select.h> definitions, and for them, the attached patch should fix the problem on earlier versions of FreeBSD.

If for some reason this patch does not go through, it will very soon be available at http://cvsweb.freebsd.org/ports/ftp/curl/files/patch-include__curl__curl.h

Actually... this patch just adds FreeBSD < 8 to the list of OS's for which <sys/select.h> is included conditionally. I wonder if this should not be made unconditional, since multi.h does use the fd_set everywhere. But for the present, this is enough to get the FreeBSD ports of other programs to build, so it's basically your call from here on :) I have no problem with this remaining a local patch in the FreeBSD port, too.

Thanks for your work on cURL!

Discussion

  • Peter Pentchev

    Peter Pentchev - 2009-12-18

    Include <sys select.h=""> on older FreeBSD versions, too.

     
  • Daniel Stenberg

    Daniel Stenberg - 2009-12-25
    • status: open --> closed-fixed
     
  • Daniel Stenberg

    Daniel Stenberg - 2009-12-25

    Thanks for the report, this problem is now fixed in CVS!