tcgetsid: Add missing declaration on OSF/1 5.1.
authorBruno Haible <bruno@clisp.org>
Sun, 19 Dec 2010 23:47:57 +0000 (00:47 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 19 Dec 2010 23:47:57 +0000 (00:47 +0100)
* 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.

ChangeLog
doc/posix-functions/tcgetsid.texi
lib/termios.in.h
m4/tcgetsid.m4
m4/termios_h.m4
modules/termios

index 62a20ce..8f08534 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 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.
        * lib/stdio.in.h: During the include_next statement, let recursive
        includes of this file include only the system header file.
index 5e1a43b..1bcc4d0 100644 (file)
@@ -8,8 +8,12 @@ Gnulib module: tcgetsid
 
 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:
index 10ef3e7..02c6c39 100644 (file)
@@ -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));
index 11dcc3d..96efb3a 100644 (file)
@@ -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 @@ AC_DEFUN([gl_FUNC_TCGETSID],
   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
index 151cc4f..1641cb8 100644 (file)
@@ -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 @@ AC_DEFUN([gl_TERMIOS_H_DEFAULTS],
 [
   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])
 ])
index 8c9ceba..09539f6 100644 (file)
@@ -26,7 +26,7 @@ termios.h: termios.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
              -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)' \