From 4555e8456f020554bcac50751fbb9b36c7d8c13b Mon Sep 17 00:00:00 2001 From: "zik.saleeba" Date: Sun, 2 Mar 2014 01:33:33 +0000 Subject: [PATCH] Implemented Mac OS X change for DrZiploc. Issue #145. git-svn-id: http://picoc.googlecode.com/svn/trunk@608 21eae674-98b7-11dd-bd71-f92a316d2d60 --- cstdlib/unistd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cstdlib/unistd.c b/cstdlib/unistd.c index d0fae32..ecbd5e0 100644 --- a/cstdlib/unistd.c +++ b/cstdlib/unistd.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "../interpreter.h" #ifndef BUILTIN_MINI_STDLIB @@ -82,7 +83,12 @@ void UnistdFchdir(struct ParseState *Parser, struct Value *ReturnValue, struct V void UnistdFdatasync(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs) { +#ifndef F_FULLSYNC ReturnValue->Val->Integer = fdatasync(Param[0]->Val->Integer); +#else + /* Mac OS X equivalent */ + ReturnValue->Val->Integer = fcntl(Param[0]->Val->Integer, F_FULLFSYNC); +#endif } void UnistdFork(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)