From 975bf7fd712baa9a21ce6453e88593065e6c1bb9 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 20 Dec 2010 00:47:57 +0100 Subject: [PATCH] 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. --- ChangeLog | 13 +++++++++++++ doc/posix-functions/tcgetsid.texi | 4 ++++ lib/termios.in.h | 2 +- m4/tcgetsid.m4 | 8 ++++++-- m4/termios_h.m4 | 4 ++-- modules/termios | 2 +- 6 files changed, 27 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 62a20ce95..8f085346d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ 2010-12-19 Bruno Haible + 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 + 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. diff --git a/doc/posix-functions/tcgetsid.texi b/doc/posix-functions/tcgetsid.texi index 5e1a43bb8..1bcc4d042 100644 --- a/doc/posix-functions/tcgetsid.texi +++ b/doc/posix-functions/tcgetsid.texi @@ -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: diff --git a/lib/termios.in.h b/lib/termios.in.h index 10ef3e7ac..02c6c39e1 100644 --- 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)); diff --git a/m4/tcgetsid.m4 b/m4/tcgetsid.m4 index 11dcc3d59..96efb3ad7 100644 --- 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 @@ AC_DEFUN([gl_FUNC_TCGETSID], dnl Persuade glibc 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 diff --git a/m4/termios_h.m4 b/m4/termios_h.m4 index 151cc4fc9..1641cb82d 100644 --- 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 @@ 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]) ]) diff --git a/modules/termios b/modules/termios index 8c9ceba1d..09539f611 100644 --- a/modules/termios +++ b/modules/termios @@ -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)' \ -- 2.11.0