[project @ 1998-04-10 10:54:14 by simonm]
[ghc-hetmet.git] / ghc / lib / std / cbits / flushFile.c
1 /* 
2  * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
3  *
4  * $Id: flushFile.c,v 1.1 1998/04/10 10:54:30 simonm Exp $
5  *
6  * hFlush Runtime Support
7  */
8
9 #include "Rts.h"
10 #include "stgio.h"
11
12 StgInt
13 flushFile(StgAddr fp)
14 {
15     int rc;
16
17     while ((rc = fflush((FILE *) fp)) != 0) {
18         if (errno != EINTR) {
19             cvtErrno();
20             stdErrno();
21             return rc;
22         }
23     }
24     return 0;
25 }