Skip to content

Commit

Permalink
Implemented Mac OS X change for DrZiploc. Issue #145.
Browse files Browse the repository at this point in the history
  • Loading branch information
zik.saleeba committed Mar 2, 2014
1 parent 18fb350 commit a3d16aa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cstdlib/unistd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <stdio.h>
#include <unistd.h>
#include <limits.h>
#include <fcntl.h>
#include "../interpreter.h"

#ifndef BUILTIN_MINI_STDLIB
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a3d16aa

Please sign in to comment.