summaryrefslogtreecommitdiffstats
path: root/Mac/Compat/sync.c
diff options
context:
space:
mode:
Diffstat (limited to 'Mac/Compat/sync.c')
-rw-r--r--Mac/Compat/sync.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/Mac/Compat/sync.c b/Mac/Compat/sync.c
new file mode 100644
index 0000000..a6487e1
--- /dev/null
+++ b/Mac/Compat/sync.c
@@ -0,0 +1,17 @@
+/* The equivalent of the Unix 'sync' system call: FlushVol.
+ Public domain by Guido van Rossum, CWI, Amsterdam (July 1987).
+ For now, we only flush the default volume
+ (since that's the only volume written to by MacB). */
+
+#include "macdefs.h"
+
+int
+sync()
+{
+ if (FlushVol((StringPtr)0, 0) == noErr)
+ return 0;
+ else {
+ errno= ENODEV;
+ return -1;
+ }
+}