summaryrefslogtreecommitdiff
path: root/ghc/lib/std/cbits/writeFile.lc
diff options
context:
space:
mode:
authorsimonm <unknown>1998-04-10 10:55:01 +0000
committersimonm <unknown>1998-04-10 10:55:01 +0000
commit3f9b5688990aa7c1170c8d995df69087b43dabeb (patch)
tree98ea8a0869cdea0562c94cfb68398ce451046176 /ghc/lib/std/cbits/writeFile.lc
parent1be6e009f6493080ea5d26cdc611279244163db1 (diff)
downloadhaskell-3f9b5688990aa7c1170c8d995df69087b43dabeb.tar.gz
[project @ 1998-04-10 10:54:14 by simonm]
New Run-Time System Support, includes: - New code generator - Modifications to the mangler - Unboxed Tuple support - Various other minor changes.
Diffstat (limited to 'ghc/lib/std/cbits/writeFile.lc')
-rw-r--r--ghc/lib/std/cbits/writeFile.lc67
1 files changed, 0 insertions, 67 deletions
diff --git a/ghc/lib/std/cbits/writeFile.lc b/ghc/lib/std/cbits/writeFile.lc
deleted file mode 100644
index 80b946f117..0000000000
--- a/ghc/lib/std/cbits/writeFile.lc
+++ /dev/null
@@ -1,67 +0,0 @@
-%
-% (c) The GRASP/AQUA Project, Glasgow University, 1994
-%
-\subsection[writeFile.lc]{hPutStr Runtime Support}
-
-\begin{code}
-
-#include "rtsdefs.h"
-#include "stgio.h"
-
-StgInt
-writeFile(buf, fp, bytes)
-StgAddr buf;
-StgForeignObj fp;
-StgInt bytes;
-{
- int count;
- char *p = (char *) buf;
-
- if (bytes == 0)
- return 0;
-
- /* Disallow short writes */
- while ((count = fwrite(p, 1, bytes, (FILE *) fp)) < bytes) {
- if (errno != EINTR) {
- cvtErrno();
- stdErrno();
- return -1;
- }
- bytes -= count;
- p += count;
- clearerr((FILE *) fp);
- }
-
- return 0;
-}
-
-
-StgInt
-writeBuf(fp, elt_sz, len, buf)
-StgForeignObj fp;
-StgWord elt_sz;
-StgInt len;
-StgAddr buf;
-{
- int count;
- char *p = (char *) buf;
-
- if (len == 0 || elt_sz == 0)
- return 0;
-
- /* Disallow short writes */
- while ((count = fwrite((char *)buf, (unsigned)elt_sz, (int)len, (FILE *) fp)) < len) {
- if (errno != EINTR) {
- cvtErrno();
- stdErrno();
- return -1;
- }
- len -= count;
- p += count;
- clearerr((FILE *) fp);
- }
-
- return 0;
-}
-
-\end{code}