summaryrefslogtreecommitdiff
path: root/ghc/lib/std/cbits/fileObject.h
diff options
context:
space:
mode:
Diffstat (limited to 'ghc/lib/std/cbits/fileObject.h')
-rw-r--r--ghc/lib/std/cbits/fileObject.h14
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