From 2fac6f35e670d13c745e152d860fc0c2cadf14ca Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 19 Dec 2010 14:33:14 +0100 Subject: [PATCH] fchdir: Add missing declaration on OSF/1 5.1. * lib/unistd.in.h (fchdir): Provide declaration if systems lacks it. * m4/fchdir.m4 (gl_FUNC_FCHDIR): Check whether fchdir is declared. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize HAVE_DECL_FCHDIR. * modules/unistd (Makefile.am): Substitute HAVE_DECL_FCHDIR. * doc/posix-functions/fchdir.texi: Mention the OSF/1 5.1 problem. --- ChangeLog | 9 +++++++++ doc/posix-functions/fchdir.texi | 3 +++ lib/unistd.in.h | 4 ++++ m4/fchdir.m4 | 8 +++++++- m4/unistd_h.m4 | 3 ++- modules/unistd | 1 + 6 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 516e7d9b4..f72a000d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2010-12-19 Bruno Haible + fchdir: Add missing declaration on OSF/1 5.1. + * lib/unistd.in.h (fchdir): Provide declaration if systems lacks it. + * m4/fchdir.m4 (gl_FUNC_FCHDIR): Check whether fchdir is declared. + * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize HAVE_DECL_FCHDIR. + * modules/unistd (Makefile.am): Substitute HAVE_DECL_FCHDIR. + * doc/posix-functions/fchdir.texi: Mention the OSF/1 5.1 problem. + +2010-12-19 Bruno Haible + relocatable-prog-wrapper: Separate from relocatable-prog. * modules/relocatable-prog (Makefile.am): Define uninstall-hook and uninstall-relocwrapper rule here. diff --git a/doc/posix-functions/fchdir.texi b/doc/posix-functions/fchdir.texi index f28971338..360f32b3d 100644 --- a/doc/posix-functions/fchdir.texi +++ b/doc/posix-functions/fchdir.texi @@ -12,6 +12,9 @@ Portability problems fixed by Gnulib: This function is missing on some platforms: Tandem/NSK, mingw, BeOS. But the replacement function is not safe to be used in libraries and is not multithread-safe. +@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/unistd.in.h b/lib/unistd.in.h index 95ac12667..6beead8c1 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -435,6 +435,10 @@ _GL_EXTERN_C void _gl_unregister_fd (int fd); _GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd); _GL_EXTERN_C const char *_gl_directory_name (int fd); +# else +# if !@HAVE_DECL_FCHDIR@ +_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/)); +# endif # endif _GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/)); _GL_CXXALIASWARN (fchdir); diff --git a/m4/fchdir.m4 b/m4/fchdir.m4 index 7bc691def..244f0f773 100644 --- a/m4/fchdir.m4 +++ b/m4/fchdir.m4 @@ -1,4 +1,4 @@ -# fchdir.m4 serial 14 +# fchdir.m4 serial 15 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, @@ -9,6 +9,12 @@ AC_DEFUN([gl_FUNC_FCHDIR], AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) AC_REQUIRE([gl_DIRENT_H_DEFAULTS]) AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + + AC_CHECK_DECLS_ONCE([fchdir]) + if test $ac_cv_have_decl_fchdir = no; then + HAVE_DECL_FCHDIR=0 + fi + AC_CHECK_FUNCS_ONCE([fchdir]) if test $ac_cv_func_fchdir = no; then HAVE_FCHDIR=0 diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4 index 31c7d00cc..5a882bbc9 100644 --- a/m4/unistd_h.m4 +++ b/m4/unistd_h.m4 @@ -1,4 +1,4 @@ -# unistd_h.m4 serial 49 +# unistd_h.m4 serial 50 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, @@ -126,6 +126,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT]) HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP]) HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) + HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR]) HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME]) HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE]) diff --git a/modules/unistd b/modules/unistd index bf94df9b7..e10797a78 100644 --- a/modules/unistd +++ b/modules/unistd @@ -100,6 +100,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \ -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ + -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \ -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \ -- 2.11.0