httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@znep.com>
Subject ap_select on BSDI 4.x
Date Sat, 29 Apr 2000 17:32:46 GMT
In mpmt_pthread, ap_select gets expanded to something like:

        select((int )( 0 ), ((fd_set *) )(  0  ), ((fd_set *) )(  0  ), ((fd_set *) )(  0
 ), ((const struct timeval *) )(  &tv )) ;

Which is pretty bogus, ie. "((fd_set *))".

Unfortunately, the autoconf mess is... well... pretty scary.

For whatever reason, SELECT_NEEDS_CAST is being set, and I'm not
sure why.  And somehow autoconf is picking out a type that is (fd_set *),
so then adding extra ()s makes it choke.  But it doesn't do that for other
things, like the first argument.

Hmm.  That looks bogus:

------------------------------------------------------------
configure:2009: checking types of arguments for select()
configure:2042: gcc -c -g -O2 -D_REENTRANT  conftest.c 1>&5
configure:2036: conflicting types for `select'
/usr/include/sys/select.h:125: previous declaration of `select'
configure: failed program was:
#line 2023 "configure"
#include "confdefs.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
extern select (int,fd_set *,fd_set *,fd_set *,struct timeval *);
int main() {

; return 0; }
------------------------------------------------------------

...but BSD/OS uses:

int     select __P((int, fd_set *, fd_set *, fd_set *, const struct timeval *));

note the const.  That's silly.  So there are two questions here.  What
to do to make configure work right and not define SELECT_NEEDS_CAST, and 
why the extra ()s are included.  The second may just be a side-effect that
doesn't matter, or it could indicate a different problem.

It looks like we have our own local random checks in configure.in for 
arguments to select() that aren't working.  Obviously, we could
just add a -o ... const sturct timeval * there, but there may be
other systems that do something else slightly differently.  Can't
configure handle doing things by itself?

Hmm.  Looking further, for whatever reason configure does:

#define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
#define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)

So it puts ()s around ac_cv_func_select_arg234 but not 1!?!  What's up
with that?

(BTW, annoying to need GNU make.  At the very least, should check for it...
and nicely give up)


Mime
View raw message