summaryrefslogtreecommitdiff
path: root/ghc/lib/std/cbits/flushFile.lc
diff options
context:
space:
mode:
Diffstat (limited to 'ghc/lib/std/cbits/flushFile.lc')
-rw-r--r--ghc/lib/std/cbits/flushFile.lc30
1 files changed, 30 insertions, 0 deletions
diff --git a/ghc/lib/std/cbits/flushFile.lc b/ghc/lib/std/cbits/flushFile.lc
new file mode 100644
index 0000000000..6cfd484e74
--- /dev/null
+++ b/ghc/lib/std/cbits/flushFile.lc
@@ -0,0 +1,30 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\subsection[flushFile.lc]{hFlush Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+StgInt
+flushFile(fp)
+StgForeignObj fp;
+{
+ int rc;
+
+ while ((rc = fflush((FILE *) fp)) != 0) {
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return rc;
+ }
+ }
+ return 0;
+}
+
+\end{code}
+
+
+