[distcc] [PATCH] timeout for gethostbyname and connect

Dimitri Papadopoulos papadopo at REMOVE.shfj.DECOY.cea.fr
Mon Dec 9 14:18:00 GMT 2002


Hi,

 > > Yeah, longjmp isn't pretty, but does __res_state work with other
 > > resolvers than glibc? (BSD, cygwin, etc.)
 >
 > Nope!  That is a shortcoming of this method.  (-:


As far as I know __res_state is present on most recent UNIX distributions.
I'm not sure it "works" though, whatever "works" means here. In any case
it's there on Solaris, IRIX, Tru64, FreeBSD, OpenBSD:

$ uname -sr
SunOS 5.8
$ fgrep __res_state /usr/include/*.h
/usr/include/resolv.h:struct __res_state;                                      /* forward */
/usr/include/resolv.h:void __h_errno_set(struct __res_state *res, int err);
/usr/include/resolv.h:struct __res_state {
/usr/include/resolv.h:typedef   struct __res_state      *res_state;
/usr/include/resolv.h:extern struct __res_state _res;
/usr/include/resolv.h:extern struct __res_state *__res_state(void);
/usr/include/resolv.h:#define   _res (*__res_state())
$

$ uname -sR
IRIX64 6.5 6.5.18f
$ fgrep __res_state /usr/include/*.h
/usr/include/resolv.h:struct __res_state {
/usr/include/resolv.h:extern struct __res_state _res;
/usr/include/resolv.h:void              fp_resstat __P((struct __res_state *, FILE *));
$

$ uname -sr
OSF1 V4.0
$ fgrep __res_state /usr/include/*.h
/usr/include/resolv.h:struct __res_state {
/usr/include/resolv.h:extern struct __res_state _res;
/usr/include/resolv.h:extern void       fp_resstat      __((struct __res_state *, FILE *));
$

http://www.freebsd.org/cgi/cvsweb.cgi/src/include/resolv.h?rev=1.21&content-type=text/x-cvsweb-markup

http://www.openbsd.org/cgi-bin/cvsweb/src/include/resolv.h?rev=1.10&content-type=text/x-cvsweb-markup


Dimitri




More information about the distcc mailing list