summaryrefslogtreecommitdiff
path: root/ghc/runtime/io/fileEOF.lc
diff options
context:
space:
mode:
Diffstat (limited to 'ghc/runtime/io/fileEOF.lc')
-rw-r--r--ghc/runtime/io/fileEOF.lc23
1 files changed, 23 insertions, 0 deletions
diff --git a/ghc/runtime/io/fileEOF.lc b/ghc/runtime/io/fileEOF.lc
new file mode 100644
index 0000000000..81128d4d9c
--- /dev/null
+++ b/ghc/runtime/io/fileEOF.lc
@@ -0,0 +1,23 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\subsection[fileEOF.lc]{hIsEOF Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+StgInt
+fileEOF(fp)
+StgAddr fp;
+{
+ if (fileLookAhead(fp) != EOF)
+ return 0;
+ else if (ghc_errtype == ERR_EOF)
+ return 1;
+ else
+ return -1;
+}
+
+\end{code}