projects
/
ghc-hetmet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[project @ 1997-01-06 17:23:41 by dnt]
[ghc-hetmet.git]
/
ghc
/
lib
/
cbits
/
filePutc.lc
1
%
2
% (c) The GRASP/AQUA Project, Glasgow University, 1994
3
%
4
\subsection[filePuc.lc]{hPutChar Runtime Support}
5
6
\begin{code}
7
8
#include "rtsdefs.h"
9
#include "stgio.h"
10
#include "error.h"
11
12
StgInt
13
filePutc(fp, c)
14
StgAddr fp;
15
StgInt c;
16
{
17
int rc;
18
19
/* Try to read a character */
20
while ((rc = putc((int) c, (FILE *) fp)) == EOF && errno == EINTR)
21
clearerr((FILE *) fp);
22
23
if (rc == EOF) {
24
cvtErrno();
25
stdErrno();
26
return -1;
27
}
28
29
return 0;
30
}
31
32
\end{code}