Added working sync() and fsync() calls.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8304 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-07-05 17:55:13 +00:00
parent eebc640361
commit c17a1f18a5
2 changed files with 36 additions and 0 deletions

View File

@ -19,6 +19,7 @@ KernelMergeObject posix_unistd.o :
<$(SOURCE_GRIST)>process.c
<$(SOURCE_GRIST)>read.c
<$(SOURCE_GRIST)>sleep.c
<$(SOURCE_GRIST)>sync.c
<$(SOURCE_GRIST)>terminal.c
<$(SOURCE_GRIST)>truncate.c
<$(SOURCE_GRIST)>ttyname.c

View File

@ -0,0 +1,35 @@
/*
** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
** Distributed under the terms of the Haiku License.
*/
#include <unistd.h>
#include <syscalls.h>
#include <errno.h>
int
fsync(int fd)
{
int status = _kern_fsync(fd);
if (status < 0) {
errno = status;
status = -1;
}
return status;
}
int
sync(void)
{
int status = _kern_sync();
if (status < 0) {
errno = status;
status = -1;
}
return status;
}