changeset 10346:1d6d83874993

test-c-stack: fix compilation failure on FreeBSD 5.0 * tests/test-c-stack.c [HAVE_SETRLIMIT]: Include prerequisite headers before <sys/resource.h>. * doc/posix-headers/sys_resource.texi (sys/resource.h): Document the bug. Reported by Nelson H. F. Beebe. Signed-off-by: Eric Blake <ebb9@byu.net>
author Eric Blake <ebb9@byu.net>
date Tue, 19 Aug 2008 21:36:21 -0600
parents 8d80c477e0ad
children f818c7d254f6
files ChangeLog doc/posix-headers/sys_resource.texi tests/test-c-stack.c
diffstat 3 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2008-08-19  Eric Blake  <ebb9@byu.net>
 
+	test-c-stack: fix compilation failure on FreeBSD 5.0
+	* tests/test-c-stack.c [HAVE_SETRLIMIT]: Include prerequisite
+	headers before <sys/resource.h>.
+	* doc/posix-headers/sys_resource.texi (sys/resource.h): Document
+	the bug.
+	Reported by Nelson H. F. Beebe.
+
 	strverscmp: migrate from "strverscmp.h" to <string.h>
 	* modules/string (Makefile.am): Add new hooks.
 	* modules/strverscmp (Files): Remove strverscmp.h.
--- a/doc/posix-headers/sys_resource.texi
+++ b/doc/posix-headers/sys_resource.texi
@@ -12,6 +12,11 @@
 Portability problems not fixed by Gnulib:
 @itemize
 @item
+On some platforms, this header file requires that <sys/types.h> and
+<sys/time.h> already be included:
+FreeBSD 5.0.
+
+@item
 This header file is missing on some platforms:
 mingw.
 @end itemize
--- a/tests/test-c-stack.c
+++ b/tests/test-c-stack.c
@@ -22,6 +22,10 @@
 #include <stdio.h>
 #include <stdlib.h>
 #if HAVE_SETRLIMIT
+/* At least FreeBSD 5.0 needs extra headers before <sys/resource.h>
+   will compile.  */
+# include <sys/types.h>
+# include <sys/time.h>
 # include <sys/resource.h>
 #endif