summaryrefslogtreecommitdiff
path: root/ghc/lib/std/cbits/fileObject.h
Commit message (Collapse)AuthorAgeFilesLines
* [project @ 2001-05-18 16:54:04 by simonmar]simonmar2001-05-181-82/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I/O library rewrite ------------------- This commit replaces the old C/Haskell I/O implementation with a new Haskell-only one using the new FFI & hsc2hs. main points: - lots of code deleted: we're about 3000 lines of C lighter, but the amount of Haskell code is about the same. - performance is ok: some operations are faster, others are slower. There's still some tuning to do, though. - the new library is designed to handle read/write streams much better: a read/write stream gets a special kind of handle internally called a "DuplexHandle", which actually contains two separate handles, one for writing and one for reading. The upshot is that you can do simultaneous reading and writing to/from a socket or FIFO without any locking problems. The effect is similar to calling socketToHandle twice, except that finalization works properly (creating two separate Handles could lead to the socket being closed too early when one of the Handles is GC'd). - hConnectTo and withHandleFor are gone (no one responded to my mail on GHC users, but we can always bring 'em back if necessary). - I made a half-hearted attempt at keeping the system-specific code in one place: see PrelPosix.hsc. - I've rearranged the I/O tests and added lots more. ghc/tests/lib/IO now contains Haskell 98-only IO tests, ghc/test/lib/{IOExts, Directory, Time} now contain tests for the relevant libraries. I haven't quite finished in here yet, the IO tests work but the others don't yet. - I haven't done anything about Unicode yet, but now we can start to discuss what needs doing here. The new library is using MutableByteArrays for its buffers because that turned out to be a *lot* easier (and quicker) than malloc'd buffers - I hope this won't cause trouble for unicode translations though. WARNING: Windows users refrain from updating until we've had a chance to fix any issues that arise. Testing: the basic H98 stuff has been pretty thoroughly tested, but the new duplex handle stuff is still a little green.
* [project @ 2000-04-14 16:26:53 by rrt]rrt2000-04-141-1/+2
| | | | Correct an off-by-one error.
* [project @ 2000-04-12 17:33:16 by simonmar]simonmar2000-04-121-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* [project @ 1999-11-25 16:54:14 by simonmar]simonmar1999-11-251-1/+13
| | | | | | | | | | | | | | 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
* [project @ 1999-11-24 10:12:12 by simonmar]simonmar1999-11-241-0/+1
| | | | wibble
* [project @ 1999-11-23 14:39:57 by simonmar]simonmar1999-11-231-13/+0
| | | | wibble
* [project @ 1999-11-23 14:38:22 by simonmar]simonmar1999-11-231-1/+0
| | | | oops, committed wrong file
* [project @ 1999-11-23 14:36:31 by simonmar]simonmar1999-11-231-0/+13
| | | | ANSIfication
* [project @ 1999-09-19 19:26:57 by sof]sof1999-09-191-0/+1
| | | | updates
* [project @ 1999-09-16 13:14:38 by simonmar]simonmar1999-09-161-1/+0
| | | | | | | | | | | | | | | | | | | | 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.
* [project @ 1999-05-05 10:33:13 by sof]sof1999-05-051-3/+5
| | | | Winsock support
* [project @ 1998-08-14 12:42:01 by sof]sof1998-08-141-0/+78
Beefed up IO stub functions to not have to rely on stdio any longer