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:
parent
eebc640361
commit
c17a1f18a5
@ -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
|
||||
|
35
src/kernel/libroot/posix/unistd/sync.c
Normal file
35
src/kernel/libroot/posix/unistd/sync.c
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user