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.
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
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));
-# 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,
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
])
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])
-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' \