Mercurial > hg > octave-nkf > gnulib-hg
changeset 15625:eab059ee71cc
fdatasync: port to MacOS X 10.7
MacOS X 10.7 added an fdatasync syscall and exports a symbol for it,
but fails to declare it anywhere. Lacking any hard evidence that this
syscall is broken, we will just provide the declaration and use it.
* m4/fdatasync.m4 (gl_FUNC_FDATASYNC): Check for present but not
declared.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Another default.
* modules/unistd (Makefile.am): Substitute it.
* lib/unistd.in.h (fdatasync): Declare on MacOS.
* doc/posix-functions/fdatasync.texi (fdatasync): Document it.
Signed-off-by: Eric Blake <eblake@redhat.com>
author | Eric Blake <eblake@redhat.com> |
---|---|
date | Fri, 16 Sep 2011 13:49:16 -0600 |
parents | 77a8f27f1e92 |
children | a508d7847f6d |
files | ChangeLog doc/posix-functions/fdatasync.texi lib/unistd.in.h m4/fdatasync.m4 m4/unistd_h.m4 modules/unistd |
diffstat | 6 files changed, 20 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2011-09-16 Eric Blake <eblake@redhat.com> + fdatasync: port to MacOS X 10.7. + * m4/fdatasync.m4 (gl_FUNC_FDATASYNC): Check for present but not + declared. + * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Another default. + * modules/unistd (Makefile.am): Substitute it. + * lib/unistd.in.h (fdatasync): Declare on MacOS. + * doc/posix-functions/fdatasync.texi (fdatasync): Document it. + fdatasync: minor improvements * modules/fdatasync (Depends-on): Add condition for fsync. * lib/fdatasync.c (fdatasync): Add comment.
--- a/doc/posix-functions/fdatasync.texi +++ b/doc/posix-functions/fdatasync.texi @@ -9,6 +9,9 @@ Portability problems fixed by Gnulib: @itemize @item +This function is present but not declared on some platforms: +MacOS X 10.7. +@item This function is missing on some platforms: MacOS X 10.5, FreeBSD 6.0, OpenBSD 3.8, Minix 3.1.8, IRIX 5.3, Solaris 2.4, mingw, MSVC 9, Interix 3.5, BeOS. @end itemize
--- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -489,7 +489,7 @@ Return 0 if successful, otherwise -1 and errno set. See POSIX:2008 specification <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>. */ -# if !@HAVE_FDATASYNC@ +# if !@HAVE_FDATASYNC@ || !@HAVE_DECL_FDATASYNC@ _GL_FUNCDECL_SYS (fdatasync, int, (int fd)); # endif _GL_CXXALIAS_SYS (fdatasync, int, (int fd));
--- a/m4/fdatasync.m4 +++ b/m4/fdatasync.m4 @@ -1,4 +1,4 @@ -# fdatasync.m4 serial 1 +# fdatasync.m4 serial 2 dnl Copyright (C) 2008-2011 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,4 +11,9 @@ if test $ac_cv_func_fdatasync = no; then HAVE_FDATASYNC=0 fi + dnl MacOS X 10.7 has fdatasync but does not declare it. + AC_CHECK_DECLS_ONCE([fdatasync]) + if test $ac_cv_have_decl_fdatasync = no; then + HAVE_DECL_FDATASYNC=0 + fi ])
--- a/m4/unistd_h.m4 +++ b/m4/unistd_h.m4 @@ -136,6 +136,7 @@ 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_FDATASYNC=1; AC_SUBST([HAVE_DECL_FDATASYNC]) 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])
--- a/modules/unistd +++ b/modules/unistd @@ -108,6 +108,7 @@ -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_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|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' \