From 4bf2b800b24ba0b0cfd069b8ec7ac173714c734d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 31 Jul 2011 23:28:02 +0200 Subject: [PATCH] sys_utsname: Add support for Minix. * lib/sys_utsname.in.h [Minix]: Include before . * m4/sys_utsname_h.m4 (gl_SYS_UTSNAME_H): Likewise. * doc/posix-headers/sys_utsname.texi: Document the Minix problem. --- ChangeLog | 8 ++++++++ doc/posix-headers/sys_utsname.texi | 3 +++ lib/sys_utsname.in.h | 8 ++++++++ m4/sys_utsname_h.m4 | 11 +++++++++-- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 54311c4db1..5ed267e393 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-07-31 Bruno Haible + + sys_utsname: Add support for Minix. + * lib/sys_utsname.in.h [Minix]: Include before + . + * m4/sys_utsname_h.m4 (gl_SYS_UTSNAME_H): Likewise. + * doc/posix-headers/sys_utsname.texi: Document the Minix problem. + 2011-07-31 Bruno Haible strings: Add support for Minix. diff --git a/doc/posix-headers/sys_utsname.texi b/doc/posix-headers/sys_utsname.texi index d53696799e..0759d262c5 100644 --- a/doc/posix-headers/sys_utsname.texi +++ b/doc/posix-headers/sys_utsname.texi @@ -10,6 +10,9 @@ Portability problems fixed by Gnulib: @item This header file is missing on some platforms: mingw. +@item +This header file is not self-contained on some platforms: +Minix 3.1.8. @end itemize Portability problems not fixed by Gnulib: diff --git a/lib/sys_utsname.in.h b/lib/sys_utsname.in.h index cc4dca01ed..0249e57e62 100644 --- a/lib/sys_utsname.in.h +++ b/lib/sys_utsname.in.h @@ -23,7 +23,15 @@ @PRAGMA_COLUMNS@ #if @HAVE_SYS_UTSNAME_H@ + +/* Minix 3.1.8 has a bug: must be included before . + But avoid namespace pollution on glibc systems. */ +# if defined __minix && !defined __GLIBC__ +# include +# endif + # @INCLUDE_NEXT@ @NEXT_SYS_UTSNAME_H@ + #endif #define _@GUARD_PREFIX@_SYS_UTSNAME_H diff --git a/m4/sys_utsname_h.m4 b/m4/sys_utsname_h.m4 index 7b48257f54..bf87c0b8bf 100644 --- a/m4/sys_utsname_h.m4 +++ b/m4/sys_utsname_h.m4 @@ -1,4 +1,4 @@ -# sys_utsname_h.m4 serial 7 +# sys_utsname_h.m4 serial 8 dnl Copyright (C) 2009-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, @@ -20,6 +20,9 @@ AC_DEFUN([gl_SYS_UTSNAME_H], else HAVE_SYS_UTSNAME_H=1 AC_CHECK_TYPES([struct utsname], [], [HAVE_STRUCT_UTSNAME=0], [[ +/* Minix 3.1.8 has a bug: must be included before + . */ +#include #include ]]) fi @@ -27,7 +30,11 @@ AC_DEFUN([gl_SYS_UTSNAME_H], dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. - gl_WARN_ON_USE_PREPARE([[#include + gl_WARN_ON_USE_PREPARE([[ + /* Minix 3.1.8 has a bug: must be included before + . */ + #include + #include ]], [uname]) ]) -- 2.30.2