From: Taylor R. Campbell Date: Sat, 21 Mar 2009 21:23:22 +0000 (+0000) Subject: Call fsync_range more carefully. It differs between NetBSD and AIX, X-Git-Tag: 20090517-FFI~44 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=741634af142323d0c7dce04c687c361c2fef6776;p=mit-scheme.git Call fsync_range more carefully. It differs between NetBSD and AIX, and FDISKSYNC was added after fsync_range to NetBSD. Someone else will need to test the AIX code (ha). --- diff --git a/v7/src/microcode/uxio.c b/v7/src/microcode/uxio.c index e4313348a..64e19e967 100644 --- a/v7/src/microcode/uxio.c +++ b/v7/src/microcode/uxio.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: uxio.c,v 1.62 2009/03/21 19:34:27 riastradh Exp $ +$Id: uxio.c,v 1.63 2009/03/21 21:23:22 riastradh Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -199,9 +199,18 @@ OS_channel_synchronize (Tchannel channel) FSYNC_SYSTEM_CALL (syscall_fdatasync, (UX_fdatasync (fd))); #endif /* HAVE_FDATASYNC */ #ifdef HAVE_FSYNC_RANGE - FSYNC_SYSTEM_CALL - (syscall_fsync_range, - (UX_fsync_range (fd, (FFILESYNC | FDISKSYNC), 0, 0))); + { + int how; +# if (defined (__NetBSD__)) + how = FFILESYNC; +# ifdef FDISKSYNC + how |= FDISKSYNC; +# endif +# elif (defined (_AIX)) + how = O_DSYNC; +# endif + FSYNC_SYSTEM_CALL (syscall_fsync_range, (UX_fsync_range (fd, how, 0, 0))); + } #endif /* HAVE_FSYNC_RANGE */ #ifdef HAVE_SYNC_FILE_RANGE FSYNC_SYSTEM_CALL