changeset 15666:bbe6ab59b982

sched: Ensure pid_t is defined. * m4/sched_h.m4 (gl_SCHED_H): Arrange to override <sched.h> if it does not define pid_t. * lib/sched.in.h: Include <sys/types.h>. * doc/posix-headers/sched.texi: Mention the pid_t problem. Reported by Tom G. Christensen <tgc@jupiterrise.com>.
author Bruno Haible <bruno@clisp.org>
date Mon, 19 Sep 2011 23:48:58 +0200
parents a68864d4e669
children df3eb2f0f1e8
files ChangeLog doc/posix-headers/sched.texi lib/sched.in.h m4/sched_h.m4
diffstat 4 files changed, 20 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-09-19  Bruno Haible  <bruno@clisp.org>
+
+	sched: Ensure pid_t is defined.
+	* m4/sched_h.m4 (gl_SCHED_H): Arrange to override <sched.h> if it does
+	not define pid_t.
+	* lib/sched.in.h: Include <sys/types.h>.
+	* doc/posix-headers/sched.texi: Mention the pid_t problem.
+	Reported by Tom G. Christensen <tgc@jupiterrise.com>.
+
 2011-09-19  Bruno Haible  <bruno@clisp.org>
 
 	msvc-inval: Ensure the entire expansion is a single statement.
--- a/doc/posix-headers/sched.texi
+++ b/doc/posix-headers/sched.texi
@@ -11,6 +11,9 @@
 This header file is missing on some platforms:
 Minix 3.1.8, mingw, MSVC 9, BeOS.
 @item
+This header file does not define the type @code{pid_t} on some platforms:
+glibc 2.11, MacOS X 10.5.
+@item
 @code{struct sched_param} is not defined on some platforms:
 Haiku.
 @item
--- a/lib/sched.in.h
+++ b/lib/sched.in.h
@@ -29,6 +29,12 @@
 #ifndef _@GUARD_PREFIX@_SCHED_H
 #define _@GUARD_PREFIX@_SCHED_H
 
+/* Get pid_t.
+   This is needed on glibc 2.11 (see
+   glibc bug <http://sourceware.org/bugzilla/show_bug.cgi?id=13198>)
+   and MacOS X 10.5.  */
+#include <sys/types.h>
+
 #if !@HAVE_STRUCT_SCHED_PARAM@
 
 # if !GNULIB_defined_struct_sched_param
--- a/m4/sched_h.m4
+++ b/m4/sched_h.m4
@@ -1,4 +1,4 @@
-# sched_h.m4 serial 5
+# sched_h.m4 serial 6
 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -13,6 +13,7 @@
        #include <sched.h>
        struct sched_param a;
        int b[] = { SCHED_FIFO, SCHED_RR, SCHED_OTHER };
+       pid_t t1;
      ]])],
     [SCHED_H=''],
     [SCHED_H='sched.h'