diff options
author | simonmar <unknown> | 1999-09-16 13:14:43 +0000 |
---|---|---|
committer | simonmar <unknown> | 1999-09-16 13:14:43 +0000 |
commit | 6986b2b2439ce264df153878374f70cee54ef100 (patch) | |
tree | 07e1b667f51039b2ee9a2c3859119a23e5afa571 /ghc/lib/std/cbits/readFile.c | |
parent | cadc82fc0a7a1e640bb04842769ca337dedb8c70 (diff) | |
download | haskell-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/readFile.c')
-rw-r--r-- | ghc/lib/std/cbits/readFile.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/ghc/lib/std/cbits/readFile.c b/ghc/lib/std/cbits/readFile.c index 7445b3ed0d..c47b56cfd9 100644 --- a/ghc/lib/std/cbits/readFile.c +++ b/ghc/lib/std/cbits/readFile.c @@ -1,7 +1,7 @@ /* * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998 * - * $Id: readFile.c,v 1.7 1999/07/12 10:43:13 sof Exp $ + * $Id: readFile.c,v 1.8 1999/09/16 13:14:43 simonmar Exp $ * * hGetContents Runtime Support */ @@ -77,9 +77,6 @@ StgForeignPtr ptr; fprintf(stderr, "rb: %d %d %d\n", fo->bufRPtr, fo->bufWPtr, fo->bufSize); #endif - if ( fo->flags & FILEOBJ_NONBLOCKING_IO && inputReady (ptr,0) != 1 ) - return FILEOBJ_BLOCKED_READ; - while ((count = ( #ifdef USE_WINSOCK @@ -170,9 +167,6 @@ StgInt len; p += count; total_count = count; - if ( fo->flags & FILEOBJ_NONBLOCKING_IO && inputReady (ptr,0) != 1 ) - return FILEOBJ_BLOCKED_READ; - while ((count = ( #ifdef USE_WINSOCK @@ -317,9 +311,6 @@ StgForeignPtr ptr; } fo->flags = (fo->flags & ~FILEOBJ_RW_WRITE) | FILEOBJ_RW_READ; - if ( fo->flags & FILEOBJ_NONBLOCKING_IO && inputReady (ptr,0) != 1 ) - return FILEOBJ_BLOCKED_READ; - while ( (count = ( #ifdef USE_WINSOCK |