From d3e6271320ff89f1fae7885f50a5d2508f8d9e88 Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Sun, 5 Jun 2011 14:20:16 +0200
Subject: [PATCH] sys_select: Ensure memset is declared also on AIX 7.

* lib/sys_select.in.h: Include <string.h> also on AIX.
* doc/posix-headers/sys_select.texi: Mention that <sys/select.h> is not
self-contained also on AIX 7.1.
---
 ChangeLog                         | 7 +++++++
 doc/posix-headers/sys_select.texi | 2 +-
 lib/sys_select.in.h               | 4 ++--
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cdc4f06ec1..599c20d464 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-06-05  Bruno Haible  <bruno@clisp.org>
+
+	sys_select: Ensure memset is declared also on AIX 7.
+	* lib/sys_select.in.h: Include <string.h> also on AIX.
+	* doc/posix-headers/sys_select.texi: Mention that <sys/select.h> is not
+	self-contained also on AIX 7.1.
+
 2011-06-04  Jim Meyering  <meyering@redhat.com>
 
 	maint.mk: sc_unmarked_diagnostics: don't hard-code "error"
diff --git a/doc/posix-headers/sys_select.texi b/doc/posix-headers/sys_select.texi
index db1b96988d..2f7cf63e29 100644
--- a/doc/posix-headers/sys_select.texi
+++ b/doc/posix-headers/sys_select.texi
@@ -19,7 +19,7 @@ OSF/1 4.0.
 @item
 This header file is not self-contained --- it requires @code{<string.h>}
 before @code{FD_ZERO} can be used --- on some platforms:
-Solaris 11 2010-11.
+AIX 7.1, Solaris 11 2010-11.
 @end itemize
 
 Portability problems not fixed by Gnulib:
diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h
index 1255a19ff0..d6d8c7be46 100644
--- a/lib/sys_select.in.h
+++ b/lib/sys_select.in.h
@@ -51,10 +51,10 @@
 #  include <sys/time.h>
 # endif
 
-/* On Solaris 10, <sys/select.h> provides an FD_ZERO implementation
+/* On AIX 7 and Solaris 10, <sys/select.h> provides an FD_ZERO implementation
    that relies on memset(), but without including <string.h>.
    But in any case avoid namespace pollution on glibc systems.  */
-# if (defined __OpenBSD__ || defined __sun || defined __osf__ || defined __BEOS__) \
+# if (defined __OpenBSD__ || defined _AIX || defined __sun || defined __osf__ || defined __BEOS__) \
      && ! defined __GLIBC__
 #  include <string.h>
 # endif
-- 
2.30.2