summaryrefslogtreecommitdiff
path: root/ghc/lib/std/cbits/fileObject.h
diff options
context:
space:
mode:
authorsimonmar <unknown>2000-04-12 17:33:17 +0000
committersimonmar <unknown>2000-04-12 17:33:17 +0000
commit313a61d546f55bb2c098ecd0ebb42e15d943201e (patch)
tree313c27ee549972fb4d9ef886e27c1708d45af9a0 /ghc/lib/std/cbits/fileObject.h
parentf016aea1357b8ce5a4f3cd866b32761cfd25f841 (diff)
downloadhaskell-313a61d546f55bb2c098ecd0ebb42e15d943201e.tar.gz
[project @ 2000-04-12 17:33:16 by simonmar]
This commit fixes the trace/stderr problem, and also fixes some other problems with the I/O library. - handles now contain a list of free buffers, which are guaranteed to be the same size as the primary handle buffer. - hPutStr now doesn't evaluate any part of the input string with the handle locked. Instead, it acquires a buffer from the handle copies characters into it, then commits the buffer. This is better for concurrency too, because the handle is only locked while we're actually reading/writing, not while evaluating. - there were an even number of off-by-one errors in the I/O system which compensated for each other. This has been fixed. - made the I/O subsystem a little more exception-safe. It still isn't totally exception-safe, but I can't face doing that without a complete rewrite of this thing in Haskell. - add hPutBufFull and hGetBufFull. The compiler probably needs to be updated to use these too.
Diffstat (limited to 'ghc/lib/std/cbits/fileObject.h')
-rw-r--r--ghc/lib/std/cbits/fileObject.h13
1 files changed, 1 insertions, 12 deletions
diff --git a/ghc/lib/std/cbits/fileObject.h b/ghc/lib/std/cbits/fileObject.h
index 4c36977a5a..df9706130a 100644
--- a/ghc/lib/std/cbits/fileObject.h
+++ b/ghc/lib/std/cbits/fileObject.h
@@ -14,18 +14,6 @@ typedef struct _IOFileObject {
int fd;
void* buf;
- int bufStart; /* offset of start of data waiting to
- be written. This may be non-zero in
- the case where we wrote out some of the
- buffer, and then blocked.
-
- NOTE: this field should be non-zero *only*
- when we just blocked on a call to writeBuffer,
- and we're going to restart the call when
- we unblock. It should be zero at all other
- times.
- */
-
int bufWPtr; /* points to next position to write,
bufRPtr >= bufWPtr <= bufSize.
@@ -44,6 +32,7 @@ typedef struct _IOFileObject {
int bufSize;
int flags;
struct _IOFileObject* connectedTo;
+
} IOFileObject;
#define FILEOBJ_LB 2