Issue #28000: Fix gethostbyname_r() usage on AIX with _LINUX_SOURCE_COMPAT

Patch by Matthieu S.
diff --git a/Misc/ACKS b/Misc/ACKS
index c687114..65fd0dc 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1214,6 +1214,7 @@
 James Rutherford
 Chris Ryland
 Constantina S.
+Matthieu S
 Patrick Sabin
 Sébastien Sablé
 Suman Saha
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 75e07c1..3e3c05f 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -167,12 +167,14 @@
 #endif
 
 #ifdef HAVE_GETHOSTBYNAME_R
-# if defined(_AIX) || defined(__osf__)
+# if defined(_AIX) && !defined(_LINUX_SOURCE_COMPAT) || defined(__osf__)
 #  define HAVE_GETHOSTBYNAME_R_3_ARG
 # elif defined(__sun) || defined(__sgi)
 #  define HAVE_GETHOSTBYNAME_R_5_ARG
 # elif defined(linux)
 /* Rely on the configure script */
+# elif defined(_LINUX_SOURCE_COMPAT) /* Linux compatibility on AIX */
+#  define HAVE_GETHOSTBYNAME_R_6_ARG
 # else
 #  undef HAVE_GETHOSTBYNAME_R
 # endif