Skip to content

Commit

Permalink
configury: set and use HAVE_FDATASYNC for fdatasync support.
Browse files Browse the repository at this point in the history
FreeBSD 10.x claims POSIX.2001 compliance, but doesn't implement
the fdatasync API.
* configure.ac (AC_CHECK_FUNCS): Add fdatasync.
* ext/posix/unistd.c (Pfdatasync, posix_unistd_fns): Elide
posix.unistd.fdatasync when HAVE_FDATASYNC was not specified,
instead of LPOSIX_2001_COMPLIANT.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
  • Loading branch information
gvvaughan committed Aug 23, 2015
1 parent 00836d3 commit f4a1237
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion configure.ac
Expand Up @@ -128,7 +128,8 @@ case $ac_cv_header_sys_msg_h,$ac_cv_func_msgrcv,$ac_cv_func_msgsnd in
;;
esac


## FreeBSD 10.x doesn't have fdatasync.
AC_CHECK_FUNCS([fdatasync])
AC_CHECK_DECLS_ONCE([fdatasync])

## Search libs
Expand Down
4 changes: 2 additions & 2 deletions ext/posix/unistd.c
Expand Up @@ -341,7 +341,7 @@ Pexecp(lua_State *L)
}


#if LPOSIX_2001_COMPLIANT
#if HAVE_FDATASYNC

#if !HAVE_DECL_FDATASYNC
extern int fdatasync ();
Expand Down Expand Up @@ -1048,7 +1048,7 @@ static const luaL_Reg posix_unistd_fns[] =
LPOSIX_FUNC( Pdup2 ),
LPOSIX_FUNC( Pexec ),
LPOSIX_FUNC( Pexecp ),
#if LPOSIX_2001_COMPLIANT
#if HAVE_FDATASYNC
LPOSIX_FUNC( Pfdatasync ),
#endif
LPOSIX_FUNC( Pfork ),
Expand Down

0 comments on commit f4a1237

Please sign in to comment.