blob: 1a8d3f965863fa630b9539b5dde7304f304dae7b [file] [log] [blame]
Guido van Rossumd4d77281994-08-19 10:51:31 +00001/* The equivalent of the Unix 'sync' system call: FlushVol.
2 Public domain by Guido van Rossum, CWI, Amsterdam (July 1987).
3 For now, we only flush the default volume
4 (since that's the only volume written to by MacB). */
5
6#include "macdefs.h"
7
Jack Jansene0c62b42002-06-26 20:43:24 +00008void
Jack Jansen9ae898b2000-07-11 21:16:03 +00009sync(void)
Guido van Rossumd4d77281994-08-19 10:51:31 +000010{
11 if (FlushVol((StringPtr)0, 0) == noErr)
Jack Jansene0c62b42002-06-26 20:43:24 +000012 return;
Guido van Rossumd4d77281994-08-19 10:51:31 +000013 else {
14 errno= ENODEV;
Jack Jansene0c62b42002-06-26 20:43:24 +000015 return;
Guido van Rossumd4d77281994-08-19 10:51:31 +000016 }
17}