2 * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
4 * $Id: writeFile.c,v 1.1 1998/04/10 10:55:00 simonm Exp $
6 * hPutStr Runtime Support
13 writeFile(StgAddr buf, StgAddr fp, StgInt bytes)
16 char *p = (char *) buf;
21 /* Disallow short writes */
22 while ((count = fwrite(p, 1, bytes, (FILE *) fp)) < bytes) {
30 clearerr((FILE *) fp);
38 writeBuf(StgAddr fp, W_ elt_sz, I_ len, StgAddr buf)
41 char *p = (char *) buf;
43 if (len == 0 || elt_sz == 0)
46 /* Disallow short writes */
47 while ((count = fwrite((char *)buf, (unsigned)elt_sz, (int)len, (FILE *) fp)) < len) {
55 clearerr((FILE *) fp);