Problem with sources - socketmodule.c

Jonathan Giddy jon at
Tue Aug 31 01:47:42 EDT 1999

pointal at (Laurent POINTAL) writes:

>Looking after the error, it was a problem of the number of arguments
>for gethost_by_name_r (and for gethotstbyaddr_r). 
>The ./configure has correctly tested my headers, found a 5 arguments
>gethost_by_name_r, and defined HAVE_GETHOSTBYNAME_R5_ARG.

>But in the socketmodule.c, the source begin by undefining the
>preprocessor symbols HAVE_GETHOSTBYNAME_* set by ./configure, and set
>them depending on the platform... and for linux it automatically set
>it to HAVE_GETHOSTBYNAME_R6_ARG. Which is false on the Slackware4

>Currently, I have put a #if !defined(linux) / #endif around the
>socketmodule.c code which modify HAVE_GETHOSTBYNAME_* and all works

>Linux 2.2.6
>egcs 2.91.66
>netdb.h v1.4 1995/08/14

The configure tests are not used because they don't work with non-ANSI 
compilers, which are still the default compilers on some platforms.

This sounds like a libc5 vs. glibc problem, but I can't find any details.
If it is, the solution is to add further tests involving the preprocessor 
defines linux and __GLIBC__, as below.  But maybe someone can confirm my
hypothesis first.

#if defined(_AIX) || defined(__osf__)
#elif defined(linux) && defined(__GLIBC__)
#elif defined(__sun__) || defined(__sgi) || defined(linux)

More information about the Python-list mailing list