--- hslibs/posix/PosixFiles.lhs.orig Tue Nov 20 07:55:00 2001 +++ hslibs/posix/PosixFiles.lhs Tue Nov 20 07:52:57 2001 @@ -253,7 +253,10 @@ exclusive :: Bool, noctty :: Bool, nonBlock :: Bool, - trunc :: Bool + trunc :: Bool, + sync :: Bool, + dSync :: Bool, + rSync :: Bool } defaultFileFlags :: OpenFileFlags @@ -263,7 +266,10 @@ exclusive = False, noctty = False, nonBlock = False, - trunc = False + trunc = False, + sync = False, + dSync = False, + rSync = False } openFd :: FilePath @@ -271,7 +277,7 @@ -> Maybe FileMode -- Just x => O_CREAT, Nothing => must exist -> OpenFileFlags -> IO Fd -openFd name how maybe_mode (OpenFileFlags append exclusive noctty nonBlock truncate) = do +openFd name how maybe_mode (OpenFileFlags append exclusive noctty nonBlock truncate sync dSync rSync) = do fd <- _ccall_ open (packString name) flags mode_w if fdToInt fd /= ((-1)::Int) then return fd @@ -287,7 +293,10 @@ (if exclusive then ``O_EXCL'' else zero) `or` (if noctty then ``O_NOCTTY'' else zero) `or` (if nonBlock then ``O_NONBLOCK'' else zero) `or` - (if truncate then ``O_TRUNC'' else zero) + (if truncate then ``O_TRUNC'' else zero) `or` + (if sync then ``O_SYNC'' else zero) `or` + (if dSync then ``O_DSYNC'' else zero) `or` + (if rSync then ``O_RSYNC'' else zero) zero = W# (int2Word# 0#) --- hslibs/posix/cbits/HsPosix.h.orig Tue Nov 20 07:40:04 2001 +++ hslibs/posix/cbits/HsPosix.h Tue Nov 20 07:48:39 2001 @@ -34,6 +34,15 @@ #ifdef HAVE_FCNTL_H #include + #ifndef O_SYNC + #define O_SYNC 0 + #endif + #ifndef O_DSYNC + #define O_DSYNC O_SYNC + #endif + #ifndef O_RSYNC + #define O_RSYNC 0 + #endif #endif /* HAVE_FCNTL_H */ #ifdef HAVE_UNISTD_H