>   A number of BSD systems have taken the non-thread-safe fuctions
> foo(), and replaced them by thread-safe versions foo_r()
> 
>   It's only weird systems like Linux that have thread-safe functions
> returning pointers to static data.

<grin>

>   The way the server is written is that it will use the thread-safe
> versions if they exist.  If not, it won't use them.

Yup.  I figured you were doing something like that with:

#ifndef HAVE_GETHOSTBYADDR_R

however:

misc.c: In function `ip_hostname':
misc.c:57: warning: passing arg 7 of `gethostbyaddr_r' from incompatible pointer type
misc.c:57: too few arguments to function `gethostbyaddr_r'
misc.c:57: warning: assignment makes pointer from integer without a cast
misc.c: In function `ip_getaddr':
misc.c:90: warning: passing arg 5 of `gethostbyname_r' from incompatible pointer type
misc.c:90: too few arguments to function `gethostbyname_r'
misc.c:90: warning: assignment makes pointer from integer without a cast

It appears that gethostbyaddr_r() always wants all eight arguments:

extern int gethostbyaddr_r (__const void *__restrict __addr, __socklen_t __len,
                            int __type,
                            struct hostent *__restrict __result_buf, 
                            char *__restrict __buf, size_t __buflen,
                            struct hostent **__restrict __result,
                            int *__restrict __h_errnop) __THROW;

It's too bad that my C is so rusty that I now know just enough to be dangerous.  Too 
much Perl hacking... :-P

For reference, this is on a system running Linux 2.4.14 and glibc-2.2.4.

--J

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to