]> Zhao Yanbai Git Server - minix.git/commitdiff
Add fsync() interface.
authorBen Gras <ben@minix3.org>
Mon, 5 Sep 2005 21:22:45 +0000 (21:22 +0000)
committerBen Gras <ben@minix3.org>
Mon, 5 Sep 2005 21:22:45 +0000 (21:22 +0000)
lib/posix/Makefile
lib/posix/_fsync.c [new file with mode: 0755]

index a985633a7d38feb218eb8937206be4d7f6cb7ef2..0eb66ff5480379f892842c69ec28d8bf6877790a 100755 (executable)
@@ -34,6 +34,7 @@ OBJECTS       = \
        $(LIBRARY)(_fpathconf.o) \
        $(LIBRARY)(_fstat.o) \
        $(LIBRARY)(_fstatfs.o) \
+       $(LIBRARY)(_fsync.o) \
        $(LIBRARY)(_getcwd.o) \
        $(LIBRARY)(_getegid.o) \
        $(LIBRARY)(_geteuid.o) \
@@ -185,6 +186,9 @@ $(LIBRARY)(_fpathconf.o):   _fpathconf.c
 $(LIBRARY)(_fstat.o):  _fstat.c
        $(CC1) _fstat.c
 
+$(LIBRARY)(_fsync.o):  _fsync.c
+       $(CC1) _fsync.c
+
 $(LIBRARY)(_fstatfs.o):        _fstatfs.c
        $(CC1) _fstatfs.c
 
diff --git a/lib/posix/_fsync.c b/lib/posix/_fsync.c
new file mode 100755 (executable)
index 0000000..86ef0a5
--- /dev/null
@@ -0,0 +1,12 @@
+#include <lib.h>
+#define sync   _sync
+#include <unistd.h>
+
+PUBLIC int fsync(int fd)
+{
+  message m;
+
+  m.m1_i1 = fd;
+
+  return(_syscall(FS, FSYNC, &m));
+}