changeset 13955:7f79090fda41

tcgetsid: Add missing declaration on OSF/1 5.1. * lib/termios.in.h (tcgetsid): Test HAVE_DECL_TCGETSID instead of HAVE_TCGETSID. * m4/tcgetsid.m4 (gl_FUNC_TCGETSID): Test whether tcgetsid is declared. Don't set HAVE_TCGETSID. * m4/termios_h.m4 (gl_TERMIOS_H_DEFAULTS): Initialize HAVE_DECL_TCGETSID, not HAVE_TCGETSID. * modules/termios (Makefile.am): Substitute HAVE_DECL_TCGETSID, not HAVE_TCGETSID. * doc/posix-functions/tcgetsid.texi: Mention the OSF/1 5.1 problem.
author Bruno Haible <bruno@clisp.org>
date Mon, 20 Dec 2010 00:47:57 +0100
parents 5a91216fb4c4
children 318a73c424b0
files ChangeLog doc/posix-functions/tcgetsid.texi lib/termios.in.h m4/tcgetsid.m4 m4/termios_h.m4 modules/termios
diffstat 6 files changed, 27 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2010-12-19  Bruno Haible  <bruno@clisp.org>
+
+	tcgetsid: Add missing declaration on OSF/1 5.1.
+	* lib/termios.in.h (tcgetsid): Test HAVE_DECL_TCGETSID instead of
+	HAVE_TCGETSID.
+	* m4/tcgetsid.m4 (gl_FUNC_TCGETSID): Test whether tcgetsid is declared.
+	Don't set HAVE_TCGETSID.
+	* m4/termios_h.m4 (gl_TERMIOS_H_DEFAULTS): Initialize
+	HAVE_DECL_TCGETSID, not HAVE_TCGETSID.
+	* modules/termios (Makefile.am): Substitute HAVE_DECL_TCGETSID, not
+	HAVE_TCGETSID.
+	* doc/posix-functions/tcgetsid.texi: Mention the OSF/1 5.1 problem.
+
 2010-12-19  Bruno Haible  <bruno@clisp.org>
 
 	stdio: Fix problem with popen() declaration on OSF/1 5.1.
--- a/doc/posix-functions/tcgetsid.texi
+++ b/doc/posix-functions/tcgetsid.texi
@@ -8,8 +8,12 @@
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
 This function is missing on some platforms:
 MacOS X 10.3, FreeBSD 6.0, OpenBSD 4.5, Cygwin, mingw, Interix 3.5, BeOS.
+@item
+This function is not declared on some platforms:
+OSF/1 5.1.
 @end itemize
 
 Portability problems not fixed by Gnulib:
--- a/lib/termios.in.h
+++ b/lib/termios.in.h
@@ -47,7 +47,7 @@
    The argument is a descriptor if this controlling terminal.
    Return -1, with errno set, upon failure.  errno = ENOSYS means that the
    function is unsupported.  */
-# if !@HAVE_TCGETSID@
+# if !@HAVE_DECL_TCGETSID@
 _GL_FUNCDECL_SYS (tcgetsid, pid_t, (int fd));
 # endif
 _GL_CXXALIAS_SYS (tcgetsid, pid_t, (int fd));
--- a/m4/tcgetsid.m4
+++ b/m4/tcgetsid.m4
@@ -1,4 +1,4 @@
-# tcgetsid.m4 serial 1
+# tcgetsid.m4 serial 2
 dnl Copyright (C) 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,9 +11,13 @@
   dnl Persuade glibc <termios.h> to declare tcgetsid().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
+  AC_CHECK_DECLS_ONCE([tcgetsid])
+  if test $ac_cv_have_decl_tcgetsid = no; then
+    HAVE_DECL_TCGETSID=0
+  fi
+
   AC_CHECK_FUNCS([tcgetsid])
   if test $ac_cv_func_tcgetsid = no; then
-    HAVE_TCGETSID=0
     AC_LIBOBJ([tcgetsid])
     gl_PREREQ_TCGETSID
   fi
--- a/m4/termios_h.m4
+++ b/m4/termios_h.m4
@@ -1,4 +1,4 @@
-# termios_h.m4 serial 1
+# termios_h.m4 serial 2
 dnl Copyright (C) 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -37,6 +37,6 @@
 [
   GNULIB_TCGETSID=0;      AC_SUBST([GNULIB_TCGETSID])
   dnl Assume proper GNU behavior unless another module says otherwise.
-  HAVE_TCGETSID=1;        AC_SUBST([HAVE_TCGETSID])
+  HAVE_DECL_TCGETSID=1;   AC_SUBST([HAVE_DECL_TCGETSID])
   HAVE_TERMIOS_H=1;       AC_SUBST([HAVE_TERMIOS_H])
 ])
--- a/modules/termios
+++ b/modules/termios
@@ -26,7 +26,7 @@
 	      -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
 	      -e 's|@''NEXT_TERMIOS_H''@|$(NEXT_TERMIOS_H)|g' \
 	      -e 's|@''GNULIB_TCGETSID''@|$(GNULIB_TCGETSID)|g' \
-	      -e 's|@''HAVE_TCGETSID''@|$(HAVE_TCGETSID)|g' \
+	      -e 's|@''HAVE_DECL_TCGETSID''@|$(HAVE_DECL_TCGETSID)|g' \
 	      -e 's|@''HAVE_TERMIOS_H''@|$(HAVE_TERMIOS_H)|g' \
 	      -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
 	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \