>From e2e77811f811e923e697a49a6d4c26b42eaeed1d Mon Sep 17 00:00:00 2001 From: KO Myung-Hun Date: Sat, 27 Apr 2013 15:33:09 +0900 Subject: [PATCH] sched: check struct sched_param in spawn.h as well On OS/2 kLIBC, struct sched_param is in spawn.h. So without this a redefinition error occurs when sched.h is inclued by spawn.h. * lib/sched.in.h: Include spawn.h on kLIBC. * lib/sched_h.m4: Check struct sched_param in spawn.h as well. --- lib/sched.in.h | 5 +++++ m4/sched_h.m4 | 13 ++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/sched.in.h b/lib/sched.in.h index edebf81..4525f41 100644 --- a/lib/sched.in.h +++ b/lib/sched.in.h @@ -45,6 +45,11 @@ struct sched_param # define GNULIB_defined_struct_sched_param 1 # endif +#elif defined __KLIBC__ + +/* On OS/2 kLIBC, struct sched_param is in spawn.h */ +# include + #endif #if !(defined SCHED_FIFO && defined SCHED_RR && defined SCHED_OTHER) diff --git a/m4/sched_h.m4 b/m4/sched_h.m4 index 329af35..a0cdc61 100644 --- a/m4/sched_h.m4 +++ b/m4/sched_h.m4 @@ -27,9 +27,16 @@ AC_DEFUN([gl_SCHED_H], fi AC_SUBST([HAVE_SCHED_H]) - AC_CHECK_TYPE([struct sched_param], - [HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0], - [#include ]) + if test "$HAVE_SCHED_H" = 1; then + AC_CHECK_TYPE([struct sched_param], + [HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0], + [#include ]) + else + dnl On OS/2 kLIBC, struct sched_param is in spawn.h. + AC_CHECK_TYPE([struct sched_param], + [HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0], + [#include ]) + fi AC_SUBST([HAVE_STRUCT_SCHED_PARAM]) dnl Ensure the type pid_t gets defined. -- 1.8.5.2