diff --git a/src/kernel/libroot/posix/unistd/Jamfile b/src/kernel/libroot/posix/unistd/Jamfile index 5c6282cbc4..987306f8fa 100644 --- a/src/kernel/libroot/posix/unistd/Jamfile +++ b/src/kernel/libroot/posix/unistd/Jamfile @@ -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 diff --git a/src/kernel/libroot/posix/unistd/sync.c b/src/kernel/libroot/posix/unistd/sync.c new file mode 100644 index 0000000000..955c1632b2 --- /dev/null +++ b/src/kernel/libroot/posix/unistd/sync.c @@ -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 +#include +#include + + +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; +}