> From: Lars Evensen
> Sent: Friday, 22 August 2003 5:45 PM

> When compiling the main part, it complains that one should compile with
> -pthreads (eventhoug I specifically told it to disable threads with
> --disable-thread option to ./configure)

Any particular reason to disable threads?

> When adding -pthread to Make.inc, the following erros occur :
> 
> make[4]: Entering directory `/kits/source/freeradius-0.9.0/src/lib'
> cc  -g -DNDEBUG -pthread -D_LIBRADIUS -I../include -c misc.c -o misc.o

[Trim]

> cc: Error: misc.c, line 60: In this statement, "gethostbyaddr_r" expects 5
> arguments, but 8 are supplied. (toomanyargs)
>         if (gethostbyaddr_r((char *)&ipaddr, sizeof(struct in_addr),
> ------------^
> cc: Warning: misc.c, line 105: In this statement, the referenced type of
> the pointer value "buffer" is "char", which is not compatible with "struct
> hostent_data". (ptrmismatch)
>         if (gethostbyname_r(host, &result, buffer, sizeof(buffer),
> -------------------------------------------^

These two indicate that gethostbyaddr_r on Tru64 is different
again from the GNU (8 arguments), SYSV (7 arguments) or BSD (3 arguments)
versions... Can you find the function prototype for gethostbyaddr_r on your
system?

Also, can you check what style of gethostbyname_r was detected by configure?
It's near the bottom of the main configure output, right above 'top_builddir'
I'm also interested in seeing config.log from
configure:7978: checking gethostbyaddr_r() syntax
onwards please? (That's 0.9.0... The line number may differ if you're using
CVS head)

> cc: Error: misc.c, line 105: In this statement, "gethostbyname_r" expects
> 3 arguments, but 6 are supplied. (toomanyargs)
>         if (gethostbyname_r(host, &result, buffer, sizeof(buffer),
> ------------^
> make[4]: *** [misc.o] Error 1

Same thing for gethostbyname_r, with GNU (6), SYSV (5), and BSD (1).

> The compiler used is the standard compiler shiped with 5.1B.
> 
> What confuses me here, is that it complains about gethostbyaddr_r requires
> 5 options, but 8 is given. According to "Unix Network programming" by
> Stevens, it is supposed to receive 7 options ;). The same with
> gethostbyname_r which here is supposed to receive 3, but gets 6. According
> to the same book, it should receive 5 (refering to the function prototypes
> on pae 304 in the Volume 1, second edition)

Your reference book is talking about the SYSV versions. It _looks_ like it's
detected GNU-style code since if it didn't find any style, it defaults to
BSD (gethostbyaddr and gethostbyname)...

The best place (I would think) to find references for your system would be
the man pages... (Tries google...)

Oh, lookie:
http://btrcx1.cip.uni-bayreuth.de/cgi-bin/manpages/gethostbyaddr/3
http://btrcx1.cip.uni-bayreuth.de/cgi-bin/manpages/gethostbyname/3
Online manpages!

They give the meaning of gethostby{addr,name}_r and list them as
deprecated on Tru64. So I guess it should be BSD.

I'd appreciate it if you could confirm that current Tru64 lists these
functions as deprecated, just in case. However, BSD-style should be safe
on Tru64 since the manpage specifies that they use 'thread-specific'
static storage, so only calls from the same thread will overwrite it.

As a quick "make-it-compile" fix (although I still want those config.log
and configure outputs) put these two lines at the top of misc.c
#define GETHOSTBYADDRRSTYLE   BSD
#define GETHOSTBYNAMERSTYLE   BSD

Based on this plus the problem observed on OpenBSD, I think there's a bug
which is selecting GNU-style instead of BSD-style, but I don't have access
to any systems which offer anything but GNU-style. (Or maybe I do... I'll
see if I can get to a SunOS box later on...)

--
=========================================================
Paul "TBBle" Hampson
Bubblesworth Pty Ltd (ABN: 51 095 284 361)
[EMAIL PROTECTED]

This is a one line proof...if we start
sufficiently far to the left.
        -- Cambridge University Math Department
---------------------------------------------------------
Random signature generator 3.0 by Paul "TBBle" Hampson
=========================================================


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

Reply via email to