diff options
author | simonmar <unknown> | 1999-11-25 16:54:15 +0000 |
---|---|---|
committer | simonmar <unknown> | 1999-11-25 16:54:15 +0000 |
commit | 0086477cfe554f9c65ae4c2f1e4e19f4e8c063eb (patch) | |
tree | 506ffebc9496dc64bbc5cf129eea5c2ebbd533c6 /ghc/lib/std/cbits/fileObject.h | |
parent | 63b4f50cfaa383118c947445e5afb4fff3cd1c91 (diff) | |
download | haskell-0086477cfe554f9c65ae4c2f1e4e19f4e8c063eb.tar.gz |
[project @ 1999-11-25 16:54:14 by simonmar]
Incremental cleanups & improvements to the I/O subsystem
- Initial fix for problems caused by partial writes
to non-blocking file descriptors. To see this bug,
run ghc/tests/programs/life_space_leak through a pipe.
- remove FILEOBJ_FLUSH, it allegedly has the same meaning
as FILEOBJ_WRITE. This fixes a buf in openFd: it erroneously didn't
set FILEOBJ_FLUSH on writeable file descriptors.
- some ANSIfication
Diffstat (limited to 'ghc/lib/std/cbits/fileObject.h')
-rw-r--r-- | ghc/lib/std/cbits/fileObject.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ghc/lib/std/cbits/fileObject.h b/ghc/lib/std/cbits/fileObject.h index deca1b0cc5..4c36977a5a 100644 --- a/ghc/lib/std/cbits/fileObject.h +++ b/ghc/lib/std/cbits/fileObject.h @@ -13,6 +13,19 @@ 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. @@ -33,7 +46,6 @@ typedef struct _IOFileObject { struct _IOFileObject* connectedTo; } IOFileObject; -#define FILEOBJ_FLUSH 1 #define FILEOBJ_LB 2 #define FILEOBJ_BB 4 #define FILEOBJ_EOF 8 |