bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tcgetsid on OSF/1


From: Bruno Haible
Subject: tcgetsid on OSF/1
Date: Mon, 20 Dec 2010 00:48:43 +0100
User-agent: KMail/1.9.9

On OSF/1 5.1, the function tcgetsid() exists but is not declared by default.
(It would be with _XOPEN_SOURCE=500, but this is not a choice we can make.)

This leads to an error:

In file included from test-termios-c++.cc:22:
../gllib/termios.h:355: error: '::tcgetsid' has not been declared
../gllib/termios.h:356: error: 'tcgetsid' was not declared in this scope
../gllib/termios.h:356: error: invalid type in declaration before ';' token
test-termios-c++.cc:28: warning: 'signature_check28' defined but not used
*** Exit 1

Here's the workaround:


2010-12-19  Bruno Haible  <address@hidden>

        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.

--- doc/posix-functions/tcgetsid.texi.orig      Mon Dec 20 00:42:54 2010
+++ doc/posix-functions/tcgetsid.texi   Mon Dec 20 00:37:14 2010
@@ -8,8 +8,12 @@
 
 Portability problems fixed by Gnulib:
 @itemize
address@hidden
 This function is missing on some platforms:
 MacOS X 10.3, FreeBSD 6.0, OpenBSD 4.5, Cygwin, mingw, Interix 3.5, BeOS.
address@hidden
+This function is not declared on some platforms:
+OSF/1 5.1.
 @end itemize
 
 Portability problems not fixed by Gnulib:
--- lib/termios.in.h.orig       Mon Dec 20 00:42:54 2010
+++ lib/termios.in.h    Mon Dec 20 00:37:45 2010
@@ -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 address@hidden@
+# if address@hidden@
 _GL_FUNCDECL_SYS (tcgetsid, pid_t, (int fd));
 # endif
 _GL_CXXALIAS_SYS (tcgetsid, pid_t, (int fd));
--- m4/tcgetsid.m4.orig Mon Dec 20 00:42:54 2010
+++ m4/tcgetsid.m4      Mon Dec 20 00:38:57 2010
@@ -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
--- m4/termios_h.m4.orig        Mon Dec 20 00:42:54 2010
+++ m4/termios_h.m4     Mon Dec 20 00:39:24 2010
@@ -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])
 ])
--- modules/termios.orig        Mon Dec 20 00:42:54 2010
+++ modules/termios     Mon Dec 20 00:39:11 2010
@@ -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)' \



reply via email to

[Prev in Thread] Current Thread [Next in Thread]