| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Remove and don't install: stgio.h, stgerror.h, fileObject.h.
|
|
|
|
|
| |
Drop in CPUTime library replacement. Still needs to be ported to
Win32.
|
|
|
|
|
| |
Remove old mingwin kludgery; using the latest version of mingwin from CVS,
things now work.
|
|
|
|
|
| |
Apply stat fix for mingw. It's ugly, it's implausible, but it seems to work.
Unlike Cygwin...(missing no. 3).
|
|
|
|
| |
Don't do a prototype for tcSetAttr if !HAVE_TERMIOS_H.
|
|
|
|
|
|
|
|
|
| |
Fix a problem with our use of tcsetattr() which caused background
processes to stop when the buffering mode, or the echo status, was
changed.
tcSetAttr() is a wrapper around tcsetattr() that temporarily blocks
SIGTTOU around the call.
|
|
|
|
|
| |
merge before-ghci -> before-ghci-branch-merged into the ghc
(non-compiler) parts of the tree.
|
|
|
|
|
|
|
| |
Change implementation of Directory.getPermissions to use access(2)
rather than stat(2). This is rather more sensible as the permissions
returned will be relevant to the current user rather than the owner of
the file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Time fixes from Michael Weber <michael.weber@post.rwth-aachen.de>:
* `toClockTime' previously didn't honor the `tz' field of a
`CalendarTime', which led to time warping when applying
=> (toUTCTime (toClockTime ... (toUTCTime (toClockTime someTime) ... )))
continuously.
Now it accepts at least <local>- and UTC-encoded `CalendarTime's
(TODO: test, whether all timezones work) and converts them
correctly to <secs from epoch>-format (which is always UTC, as one
might have guessed).
* `addToClockTime' now works.
Previously, `tz' seconds were added(!) when used like:
=> addToClockTime noTimeDiff someTime
which is clearly wrong.
Now, the following (hopefully) always holds
=> someTime == (addToClockTime noTimeDiff someTime)
* `diffClockTimes' works correctly, and is the dual to
`addToClockTime', i.e.
=> diff == ((addToClockTime diff someTime) `diffClockTimes` someTime)
should now hold for all diff, someTime
Previously, it reports ugly diffs at {min,hour,day,...}-breaks,
for example:
=> "2000/06/18 01:00 UTC"
`diffClockTimes` "2000/06/17 23:00 UTC" == 1 day, -22 hours
whereas now it emits "7200 secs". This number can be converted
with `normalizeTimeDiff' to "2 hours".
* added `normalizeTimeDiff', which calculates year, month, days,
etc. out of an unnormalized `TimeDiff' (generated by
`diffClockTimes', for example)
* `formatTimeDiff': added the missing "%c" case. The
format is proprietary, though... Is there a nicer one?
|
|
|
|
|
|
|
|
|
| |
The C functions toLocalTime and toUTCTime now return an StgInt, not a
rather useless StgAddr. This fixes two gcc warnings during the
compilation of Time. In the course of this, toLocalTime.c and
toUTCTime.c are synched a little bit more.
(*please merge*)
|
|
|
|
| |
Add addrOf_ErrorHdrHook prototype
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Cleaning up the foreign object naming mess:
* Renamed the primop from makeForeignObj# to mkForeignObj#, this
is more consistent with the old Foreign.mkForeignObj.
* PrelForeign now exports makeForeignObj with the new signature.
* freeFile.c now uses StgAddr instead of StgForeignObj, this
removes the need for some fixIOs.
* Lots of import tweaking to prepare The Big Foreign Renamer,
which will move most of Foreign to ForeignObj, and FFI to Foreign.
Note: I've tried to track the changes in the interpreter sources, but
didn't test them.
|
|
|
|
|
|
| |
Fix h{Fill,Put}Buf(BA)?. They now work in the presence of
partial/blocking reads and writes, and hPutBuf now doesn't hold on to
the handle while it's blocking.
|
|
|
|
| |
misc ansification and -Wall cleanup
|
|
|
|
| |
Rename error.h to stgerror.h
|
|
|
|
| |
Simplified the interface between CPUTime.getCPUTime and getCPUTime()
|
|
|
|
| |
primGetClockTime was incorrectly calling prim_getClockTime; fixed dormant bug in Show instance for ClockTime
|
|
|
|
| |
updates
|
|
|
|
|
|
| |
Let's try again - added get_ZONE(), which retrieves current
timezone string. Need to do this since cygwin doesn't initialise
its tzname[] properly (=> need to call tzset() explicitly.)
|
|
|
|
|
|
|
|
|
|
|
|
| |
- relax the restriction that just the one open writeable handle on
*the same file* may exist when dealing with the standard handles,
stdout and stderr.
Reason: the following invocation of a Haskell program,
foo >log 2>&1
should be acceptable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Re-integrated mod. that seems to have been dropped on the
floor when new-rts moved back onto the main trunk. Here's
the commit msg. that was originally used:
Extend hConnectTo to also allow output handles to be connected, i.e.,
h1 <- openFile "foo" WriteMode
h2 <- openFile "bar" WriteMode
hConnectTo h1 h2
will cause h1's buffer to be flushed when h2's buffer overflows
(and it is just about to be flushed.) The implementation is currently
not as lazy as that, it flushes h1's buffer regardless of whether a
write to h2 causes h2's buffer to overflow or not.
This is used to connect 'stderr' and 'stdout', i.e., output on
'stderr' will now cause 'stdout' output to (first) be flushed.
|
|
|
|
| |
Move 4.01 onto the main trunk.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extend hConnectTo to also allow output handles to be connected, i.e.,
h1 <- openFile "foo" WriteMode
h2 <- openFile "bar" WriteMode
hConnectTo h1 h2
will cause h1's buffer to be flushed when h2's buffer overflows
(and it is just about to be flushed.) The implementation is currently
not as lazy as that, it flushes h1's buffer regardless of whether h2's
buffer overflows or not.
This is used to connect 'stderr' and 'stdout', i.e., output on
'stderr' will now cause 'stdout' output to (first) be flushed.
|
|
|
|
| |
Fixed endian bug that struck when outputting on non-buffered handles
|
|
|
|
| |
Beefed up IO stub functions to not have to rely on stdio any longer
|
|
|
|
| |
New functions for getting/setting terminal echo via handles; allow non-std setting/getting of buffering on semi-closed handles
|
|
|
|
|
|
|
|
| |
- closeFile: make sure that (FILE*)s pointing to non-regular,
unlocked files (sockets, FDs etc.) are closed.
- new function: openFd, which implements process local file locking
for files that are initially opened by the Posix Fd-based ops before
being converted into a Haskell handle by Posix.fdToHandle
|
|
|
|
| |
Simplified C stubs used to implement Directory.getDirectoryContents
|
|
Library re-organisation:
All libraries now live under ghc/lib, which has the following structure:
ghc/lib/std -- all prelude files (libHS.a)
ghc/lib/std/cbits
ghc/lib/exts -- standard Hugs/GHC extensions (libHSexts.a)
-- available with '-fglasgow-exts'
ghc/lib/posix -- POSIX library (libHSposix.a)
ghc/lib/posix/cbits -- available with '-syslib posix'
ghc/lib/misc -- used to be hslibs/ghc (libHSmisc.a)
ghc/lib/misc/cbits -- available with '-syslib misc'
ghc/lib/concurrent -- Concurrent libraries (libHSconc.a)
-- available with '-concurrent'
Also, several non-standard prelude modules had their names changed to begin
with 'Prel' to reduce namespace pollution.
Addr ==> PrelAddr (Addr interface available in 'exts')
ArrBase ==> PrelArr
CCall ==> PrelCCall (CCall interface available in 'exts')
ConcBase ==> PrelConc
GHCerr ==> PrelErr
Foreign ==> PrelForeign (Foreign interface available in 'exts')
GHC ==> PrelGHC
IOHandle ==> PrelHandle
IOBase ==> PrelIOBase
GHCmain ==> PrelMain
STBase ==> PrelST
Unsafe ==> PrelUnsafe
UnsafeST ==> PrelUnsafeST
|