sched: Ensure pid_t is defined.
authorBruno Haible <bruno@clisp.org>
Mon, 19 Sep 2011 21:48:58 +0000 (23:48 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 19 Sep 2011 21:49:55 +0000 (23:49 +0200)
* 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>.

ChangeLog
doc/posix-headers/sched.texi
lib/sched.in.h
m4/sched_h.m4

index 6172673..3f4b62f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 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.
        * lib/msvc-inval.h (TRY_MSVC_INVAL, DONE_MSVC_INVAL): Add an extra pair
        of braces.
index 82d198e..8dacddf 100644 (file)
@@ -11,6 +11,9 @@ Portability problems fixed by Gnulib:
 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
index 10405d0..fc2e171 100644 (file)
 #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
index e6ff995..28b6dbd 100644 (file)
@@ -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 @@ AC_DEFUN([gl_SCHED_H],
        #include <sched.h>
        struct sched_param a;
        int b[] = { SCHED_FIFO, SCHED_RR, SCHED_OTHER };
+       pid_t t1;
      ]])],
     [SCHED_H=''],
     [SCHED_H='sched.h'