summaryrefslogtreecommitdiff
path: root/ghc/lib/std/cbits/fileObject.c
diff options
context:
space:
mode:
authorsimonmar <unknown>1999-09-16 13:14:43 +0000
committersimonmar <unknown>1999-09-16 13:14:43 +0000
commit6986b2b2439ce264df153878374f70cee54ef100 (patch)
tree07e1b667f51039b2ee9a2c3859119a23e5afa571 /ghc/lib/std/cbits/fileObject.c
parentcadc82fc0a7a1e640bb04842769ca337dedb8c70 (diff)
downloadhaskell-6986b2b2439ce264df153878374f70cee54ef100.tar.gz
[project @ 1999-09-16 13:14:38 by simonmar]
Cleanup of non-blocking I/O - file descriptors are now always set to non-blocking mode. - we don't do an inputReady operation on descriptors before attempting to read from them any more. - the non-blocking flag on Handles has gone. - the {set,clear}[Conn]NonBlockingFlag() functions have gone. - the socket operations have been made to work properly with threads: accept is now non-blocking (it does a threadWaitRead instead of blocking), and the file descriptors returned by accept are set to non-blocking mode. Win32 will need some adjustments, no doubt.
Diffstat (limited to 'ghc/lib/std/cbits/fileObject.c')
-rw-r--r--ghc/lib/std/cbits/fileObject.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/ghc/lib/std/cbits/fileObject.c b/ghc/lib/std/cbits/fileObject.c
index d209f6693f..b8b009d3ec 100644
--- a/ghc/lib/std/cbits/fileObject.c
+++ b/ghc/lib/std/cbits/fileObject.c
@@ -1,7 +1,7 @@
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
- * $Id: fileObject.c,v 1.5 1999/07/12 10:43:12 sof Exp $
+ * $Id: fileObject.c,v 1.6 1999/09/16 13:14:42 simonmar Exp $
*
* hPutStr Runtime Support
*/
@@ -136,32 +136,6 @@ StgInt
getPushbackBufSize()
{ return (__pushback_buf_size__); }
-void
-clearNonBlockingIOFlag__ (ptr)
-StgForeignPtr ptr;
-{ ((IOFileObject*)ptr)->flags &= ~FILEOBJ_NONBLOCKING_IO; }
-
-void
-setNonBlockingIOFlag__ (ptr)
-StgForeignPtr ptr;
-{ ((IOFileObject*)ptr)->flags |= FILEOBJ_NONBLOCKING_IO; }
-
-void
-clearConnNonBlockingIOFlag__ (ptr)
-StgForeignPtr ptr;
-{ ((IOFileObject*)ptr)->connectedTo->flags &= ~FILEOBJ_NONBLOCKING_IO; }
-
-void
-setConnNonBlockingIOFlag__ (ptr)
-StgForeignPtr ptr;
-{
- if ( ((IOFileObject*)ptr)->connectedTo != NULL ) {
- ((IOFileObject*)ptr)->connectedTo->flags |= FILEOBJ_NONBLOCKING_IO;
- }
- return;
-}
-
-
/* Only ever called on line-buffered file objects */
StgInt
fill_up_line_buffer(fo)
@@ -180,9 +154,6 @@ IOFileObject* fo;
len = fo->bufSize - fo->bufWPtr + 1;
p = (unsigned char*)fo->buf + fo->bufWPtr;
- if ( fo->flags & FILEOBJ_NONBLOCKING_IO && inputReady ((StgForeignPtr)fo,0) != 1 )
- return FILEOBJ_BLOCKED_READ;
-
if ((count =
(
#ifdef USE_WINSOCK