changeset 38908:aa19959eb698

ioctl: Override non-POSIX declaration on Haiku. * m4/ioctl.m4 (gl_FUNC_IOCTL): Include also <unistd.h>. * lib/sys_ioctl.in.h: Add comment about Haiku. * doc/posix-functions/ioctl.texi: Mention Haiku problem. * doc/glibc-headers/sys_ioctl.texi: Likewise.
author Bruno Haible <bruno@clisp.org>
date Sun, 29 Oct 2017 02:22:19 +0200
parents 52ddf7a4ff18
children 2fb10296eb1e
files ChangeLog doc/glibc-headers/sys_ioctl.texi doc/posix-functions/ioctl.texi lib/sys_ioctl.in.h m4/ioctl.m4
diffstat 5 files changed, 16 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Oct 28 22:25:30 2017 +0200
+++ b/ChangeLog	Sun Oct 29 02:22:19 2017 +0200
@@ -1,3 +1,11 @@
+2017-10-28  Bruno Haible  <bruno@clisp.org>
+
+	ioctl: Override non-POSIX declaration on Haiku.
+	* m4/ioctl.m4 (gl_FUNC_IOCTL): Include also <unistd.h>.
+	* lib/sys_ioctl.in.h: Add comment about Haiku.
+	* doc/posix-functions/ioctl.texi: Mention Haiku problem.
+	* doc/glibc-headers/sys_ioctl.texi: Likewise.
+
 2017-10-28  Bruno Haible  <bruno@clisp.org>
 
 	crypto/sm3: Add overview documentation to the .h file.
--- a/doc/glibc-headers/sys_ioctl.texi	Sat Oct 28 22:25:30 2017 +0200
+++ b/doc/glibc-headers/sys_ioctl.texi	Sun Oct 29 02:22:19 2017 +0200
@@ -25,7 +25,7 @@
 mingw, MSVC 14.
 @item
 This header file does not declare the @code{ioctl} function on some platforms:
-AIX 5.1, Solaris 11.3.
+AIX 5.1, Solaris 11.3, Haiku 2017.
 @end itemize
 
 Portability problems not fixed by Gnulib:
--- a/doc/posix-functions/ioctl.texi	Sat Oct 28 22:25:30 2017 +0200
+++ b/doc/posix-functions/ioctl.texi	Sun Oct 29 02:22:19 2017 +0200
@@ -15,7 +15,7 @@
 @item
 The second parameter is of type @code{unsigned long} rather than @code{int}
 on some platforms:
-glibc 2.26, Mac OS X 10.5, FreeBSD 11.0, NetBSD 7.0, OpenBSD 6.0, BeOS.
+glibc 2.26, Mac OS X 10.5, FreeBSD 11.0, NetBSD 7.0, OpenBSD 6.0, BeOS, Haiku 2017.
 @end itemize
 
 Portability problems not fixed by Gnulib:
--- a/lib/sys_ioctl.in.h	Sat Oct 28 22:25:30 2017 +0200
+++ b/lib/sys_ioctl.in.h	Sun Oct 29 02:22:19 2017 +0200
@@ -31,6 +31,7 @@
 
 /* AIX 5.1 and Solaris 10 declare ioctl() in <unistd.h> and in <stropts.h>,
    but not in <sys/ioctl.h>.
+   Haiku declares ioctl() in <unistd.h>, but not in <sys/ioctl.h>.
    But avoid namespace pollution on glibc systems.  */
 #ifndef __GLIBC__
 # include <unistd.h>
--- a/m4/ioctl.m4	Sat Oct 28 22:25:30 2017 +0200
+++ b/m4/ioctl.m4	Sun Oct 29 02:22:19 2017 +0200
@@ -1,4 +1,4 @@
-# ioctl.m4 serial 4
+# ioctl.m4 serial 5
 dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -23,7 +23,10 @@
       [gl_cv_func_ioctl_posix_signature],
       [AC_COMPILE_IFELSE(
          [AC_LANG_PROGRAM(
-            [[#include <sys/ioctl.h>]],
+            [[#include <sys/ioctl.h>
+              /* On some platforms, ioctl() is declared in <unistd.h>.  */
+              #include <unistd.h>
+            ]],
             [[extern
               #ifdef __cplusplus
               "C"