char buf[1001];
int buf_len = (sizeof buf) - 1;
int errnop;
+#if defined(linux) && (__GLIBC__ >= 2)
+ int result;
+#endif
#endif /* HAVE_GETHOSTBYNAME_R */
memset((void *) addr_ret, '\0', sizeof(*addr_ret));
}
Py_BEGIN_ALLOW_THREADS
#ifdef HAVE_GETHOSTBYNAME_R
+#if defined(linux) && (__GLIBC__ >= 2)
+ result = gethostbyname_r(name, &hp_allocated, buf, buf_len, &hp, &errnop);
+#else
hp = gethostbyname_r(name, &hp_allocated, buf, buf_len, &errnop);
+#endif
#else /* not HAVE_GETHOSTBYNAME_R */
#if defined(WITH_THREAD) && !defined(MS_WINDOWS)
PyThread_acquire_lock(gethostbyname_lock,1);
char buf[16384];
int buf_len = (sizeof buf) - 1;
int errnop;
+#if defined(linux) && (__GLIBC__ >= 2)
+ int result;
+#endif
#endif /* HAVE_GETHOSTBYNAME_R */
if (!PyArg_Parse(args, "s", &name))
return NULL;
return NULL;
Py_BEGIN_ALLOW_THREADS
#ifdef HAVE_GETHOSTBYNAME_R
+#if defined(linux) && (__GLIBC__ >= 2)
+ result = gethostbyname_r(name, &hp_allocated, buf, buf_len, &h, &errnop);
+#else
h = gethostbyname_r(name, &hp_allocated, buf, buf_len, &errnop);
+#endif
#else /* not HAVE_GETHOSTBYNAME_R */
#if defined(WITH_THREAD) && !defined(MS_WINDOWS)
PyThread_acquire_lock(gethostbyname_lock,1);
char buf[16384];
int buf_len = (sizeof buf) - 1;
int errnop;
+#if defined(linux) && (__GLIBC__ >= 2)
+ int result;
+#endif
#endif /* HAVE_GETHOSTBYNAME_R */
if (!PyArg_Parse(args, "s", &ip_num))
return NULL;
Py_BEGIN_ALLOW_THREADS
#ifdef HAVE_GETHOSTBYNAME_R
+#if defined(linux) && (__GLIBC__ >= 2)
+ result = gethostbyaddr_r((char *)&addr.sin_addr,
+ sizeof(addr.sin_addr),
+ AF_INET, &hp_allocated, buf, buf_len,
+ &h, &errnop);
+#else
h = gethostbyaddr_r((char *)&addr.sin_addr,
sizeof(addr.sin_addr),
AF_INET,
&hp_allocated, buf, buf_len, &errnop);
+#endif
#else /* not HAVE_GETHOSTBYNAME_R */
#if defined(WITH_THREAD) && !defined(MS_WINDOWS)
PyThread_acquire_lock(gethostbyname_lock,1);