diff options
author | Bruno Haible <bruno@clisp.org> | 2010-12-20 13:10:22 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2010-12-20 13:10:22 +0100 |
commit | 5ceff07480611f65854730efe3b07e3f6de2ba80 (patch) | |
tree | ca210f1122da3d7a23ab3bc5b9c3c79c40730193 /m4 | |
parent | 7a85bea5631913483046e8f47893e4d42dafb2c9 (diff) | |
download | gnulib-5ceff07480611f65854730efe3b07e3f6de2ba80.tar.gz |
ttyname_r: Add missing declaration on HP-UX 11.
* lib/unistd.in.h (ttyname_r): Test HAVE_DECL_TTYNAME_R instead of
HAVE_TTYNAME_R.
* m4/ttyname_r.m4 (gl_FUNC_TTYNAME_R): Test whether ttyname_r is
declared. Set HAVE_TTYNAME_R always.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize
HAVE_DECL_TTYNAME_R, not HAVE_TTYNAME_R.
* modules/unistd (Makefile.am): Substitute HAVE_DECL_TTYNAME_R, not
HAVE_TTYNAME_R.
* doc/posix-functions/ttyname_r.texi: Document the HP-UX 11 problem.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/ttyname_r.m4 | 8 | ||||
-rw-r--r-- | m4/unistd_h.m4 | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/m4/ttyname_r.m4 b/m4/ttyname_r.m4 index 7e87cc3350..ad760703ca 100644 --- a/m4/ttyname_r.m4 +++ b/m4/ttyname_r.m4 @@ -1,4 +1,4 @@ -# ttyname_r.m4 serial 5 +# ttyname_r.m4 serial 6 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, @@ -12,10 +12,16 @@ AC_DEFUN([gl_FUNC_TTYNAME_R], dnl ttyname_r(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_DECLS_ONCE([ttyname_r]) + if test $ac_cv_have_decl_ttyname_r = no; then + HAVE_DECL_TTYNAME_R=0 + fi + AC_CHECK_FUNCS([ttyname_r]) if test $ac_cv_func_ttyname_r = no; then HAVE_TTYNAME_R=0 else + HAVE_TTYNAME_R=1 dnl On MacOS X 10.4 (and Solaris 10 without gl_USE_SYSTEM_EXTENSIONS) dnl the return type is 'char *', not 'int'. AC_CACHE_CHECK([whether ttyname_r is compatible with its POSIX signature], diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4 index 5a882bbc92..27d96ff82a 100644 --- a/m4/unistd_h.m4 +++ b/m4/unistd_h.m4 @@ -1,4 +1,4 @@ -# unistd_h.m4 serial 50 +# unistd_h.m4 serial 51 dnl Copyright (C) 2006-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, @@ -122,7 +122,6 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK]) HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT]) - HAVE_TTYNAME_R=1; AC_SUBST([HAVE_TTYNAME_R]) HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT]) HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP]) HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) @@ -131,6 +130,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE]) HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL]) + HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R]) HAVE_OS_H=0; AC_SUBST([HAVE_OS_H]) HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) |