| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
Move this to the Attic
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Win32 rawSystem: set errno to EINVAL on error. This is a gross hack,
but is slightly better than the existing situation (errno not set at
all, caller tries to report errno and draws a blank).
Microsoft's C runtime has a conversion function from Win32 error codes
into errno error codes, but it isn't part of the external interface.
grrrrr.
Strictly speaking, we should have support for Win32 error codes in the
base package.
|
|
|
|
| |
wibble
|
|
|
|
|
| |
More ugly hacks related to the config.h change. I'm beginning to
think maybe this wasn't such a great idea.
|
|
|
|
| |
#ifdefery to work around change in name of config.h
|
|
|
|
|
| |
Changes required be merge of backend-hacking-branch. Mostly config.h
==> ghcconfig.h.
|
|
|
|
|
| |
To make Text.Regex.Posix work with Hugs, move cbits/regex/regex.h under
include, where Hugs can find it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The lock arrays are too small on Windows, leading to buffer overruns
and crashes when a program opens too many files.
The problem is that on Windows, we shouldn't use FD_SETSIZE to get the
max number of file descriptors: this is set to 64 in the mingw
includes. The real maximum is 2048 (according to the crt sources), so
we now hardwire that in.
Also, put in a runtime check that we aren't overruning this array.
MERGE TO STABLE
|
|
|
|
|
|
| |
Added interface to set/get handler for uncatched exceptions.
The handler is invoked from the GHC.TopHandler.topHandler or
Control.Concurrent.childHandler when an exception is catched.
|
|
|
|
| |
plug a warning
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix, and simplify, the getting/setting of errno in Foreign.C.Error.
It was previously wrong: although we called a C function to get the
location of errno (correct), we cached the result in a CAF which was
wrong because the location is OS thread dependent. We must call the C
function every time we need the value of errno.
I also simplified things by making the getter/setter functions inlined
in the same way as the other C fragments in this library, and putting
them in HsBase.h.
MERGE TO STABLE
|
|
|
|
| |
Synched #ifdefs, but only 90% sure if I got it right...
|
|
|
|
| |
code tidyup
|
|
|
|
|
|
|
|
| |
Fix a memory leak in __hscore_readdir() which meant that one struct
dirent was leaked at the end of each directory read.
Bug-reported-by: David Roundy <droundy@abridgegame.org>
What-a-great-system: Valgrind
|
|
|
|
| |
Comment use of $(HavePosixRegex)
|
|
|
|
| |
more mind-numbing CPP tweaking
|
|
|
|
|
|
|
|
| |
Move forkOS_createThread into the RTS so its implementation can be
dependent on RTS_SUPPORTS_THREADS, which means we can provide a stub
implementation in the !RTS_SUPPORTS_THREADS case, and hence not depend
on pthread_create, which requires -lpthread. The upshot is that GHCi
now works again when !RTS_SUPPORTS_THREADS.
|
|
|
|
| |
[win32]: make it compile
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bound Threads
=============
Introduce a way to use foreign libraries that rely on thread local state
from multiple threads (mainly affects the threaded RTS).
See the file threads.tex in CVS at haskell-report/ffi/threads.tex
(not entirely finished yet) for a definition of this extension. A less formal
description is also found in the documentation of Control.Concurrent.
The changes mostly affect the THREADED_RTS (./configure --enable-threaded-rts),
except for saving & restoring errno on a per-TSO basis, which is also necessary
for the non-threaded RTS (a bugfix).
Detailed list of changes
------------------------
- errno is saved in the TSO object and restored when necessary:
ghc/includes/TSO.h, ghc/rts/Interpreter.c, ghc/rts/Schedule.c
- rts_mainLazyIO is no longer needed, main is no special case anymore
ghc/includes/RtsAPI.h, ghc/rts/RtsAPI.c, ghc/rts/Main.c, ghc/rts/Weak.c
- passCapability: a new function that releases the capability and "passes"
it to a specific OS thread:
ghc/rts/Capability.h ghc/rts/Capability.c
- waitThread(), scheduleWaitThread() and schedule() get an optional
Capability *initialCapability passed as an argument:
ghc/includes/SchedAPI.h, ghc/rts/Schedule.c, ghc/rts/RtsAPI.c
- Bound Thread scheduling (that's what this is all about):
ghc/rts/Schedule.h, ghc/rts/Schedule.c
- new Primop isCurrentThreadBound#:
ghc/compiler/prelude/primops.txt.pp, ghc/includes/PrimOps.h, ghc/rts/PrimOps.hc,
ghc/rts/Schedule.h, ghc/rts/Schedule.c
- a simple function, rtsSupportsBoundThreads, that returns true if THREADED_RTS
is defined:
ghc/rts/Schedule.h, ghc/rts/Schedule.c
- a new implementation of forkProcess (the old implementation stays in place
for the non-threaded case). Partially broken; works for the standard
fork-and-exec case, but not for much else. A proper forkProcess is
really next to impossible to implement:
ghc/rts/Schedule.c
- Library support for bound threads:
Control.Concurrent.
rtsSupportsBoundThreads, isCurrentThreadBound, forkOS,
runInBoundThread, runInUnboundThread
libraries/base/Control/Concurrent.hs, libraries/base/Makefile,
libraries/base/include/HsBase.h, libraries/base/cbits/forkOS.c (new file)
|
|
|
|
|
| |
inputReady(): the time calculation for select() was wrong, forgetting
to multiply the milliseconds value by 1000 to get microseconds.
|
|
|
|
|
|
|
| |
[win32]renameFile:
Try bridging between GetLastError() error values and the
errno-based error handling code in System.Directory. As was,
errors ended up being reported as 'no errors'.
|
|
|
|
| |
Warning police
|
|
|
|
|
|
|
|
|
|
|
| |
For System.Directory.renameFile on Win32 platforms, implement the Haskell98
semantics of replacing the target file if it already exists (i.e.,
file/directory renaming is now done by dirUtils.c:__hscore_renameFile().)
Document that System.Directory.renameDirectory will fail on Win32 boxes should
the target directory exist.
Merge to STABLE, I suppose.
|
|
|
|
| |
fork() never returns with EINTR
|
|
|
|
| |
fork() never returns with EINTR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the type of System.Cmd.rawSystem:
rawSystem :: FilePath -> [String] -> IO ExitCode
and implement it properly on both Windows & Unix. The intended
meaning is that the program is executed with *exactly* these
arguments.
We now re-use this rawSystem in the compiler itself (using it directly
from the library if __GLASGOW_HASKELL__ >= 601).
The previous implementation of SysTools.runSomething was broken on
4.08, because Posix.executeFile was broken. However, implementing the
new rawSystem on 4.08 is tricky, because it uses the FFI marshalling
libraries which weren't present on 4.08. Hence, bootstrapping from
4.08 is now not possible (it was already not possible on Windows). It
could be made possible by importing enough FFI marshalling support,
but I won't bother doing that unless/until it is needed.
|
|
|
|
|
|
|
| |
Add support for using vfork, which I apparently removed when this file
was moved over from ghc/lib/std/cbits. Using vfork on Linux makes
quite a big difference - eg. when building GHC.Base with -split-objs ,
I saw a 2.5s reduction in system time.
|
|
|
|
|
| |
Fix bugs caused by missing casts in arithmetic expressions in
stg_integerToInt64 and stg_integerToWord64.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Re-instate the checking for the values of errno constants at configure
time. The problem with doing it using foreign calls is simply that
this tickles a bad case in the code gen machinery, which in this case
results in an extra 10-20k of goop ending up in pretty much every
binary, and it impacts GC performance too.
This has some portability implications, but the situation is no worse
than before. To reliably cross-compile for a new platform you need to
build a set of .hc files for the libraries using a config.h generated on
the *target* machine. (at some point we'll formalise the
cross-compilation story, but that's another thing on the todo list...)
|
|
|
|
|
|
|
| |
- Move rawSystem from SystemExts to System.Cmd.
- Move withArgv and withProgName from SystemExts to System.Environment
These functions are still exported by SystemExts for compatibility.
|
|
|
|
|
|
|
| |
inputReady(): using MsgWaitForMultipleObjects() instead of
WaitForMultipleObjects() on file handles is nicer from within a
message pump, but here it is less confusing to use the latter (and
simply just block message delivery for its duration.)
|
|
|
|
| |
helper functions for mucking about with Win32 consoles
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sigh, enabling _POSIX_PTHREAD_SEMANTICS causes the Solaris header
files to drop several silly little C functions into the source code.
We don't want these duplicated in every Haskell-compiled object.
So plan B: just define _POSIX_PTHREAD_SEMANTICS in dirUtils.c where it
is needed to make readdir_r work. I've checked, and readdir_r is the
only function we use that is affected by _POSIX_PTHREAD_SEMANTICS. If
we ever use any more of these functions, then we'll have to be careful
to give them a C wrapper.
|
|
|
|
| |
cygwin: stick with system()
|
|
|
|
| |
provide isblank() for Win32
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix 64-bit shift operations.
- Move the declarations of the 64-bit "primops" from PrimOps.h to
HsBase.h where they more properly belong.
- change the names of the 64-bit shift ops to include the "unchecked"
prefix
- add checked versions of these primops to GHC.Int and GHC.Word, and
use them.
- update the FFI declarations in GHC.Int and GHC.Word while I'm there.
|
|
|
|
| |
Remove __P from prototypes
|
|
|
|
|
| |
- include <sys/types.h> rather than non-std <sys/cdefs.h>
- remove use of __P-style prototypes
|
|
|
|
| |
mingw32 doesn't define _POSIX2_RE_DUP_MAX, it seems
|
|
|
|
|
|
|
| |
Fixes to 'make install' in fptools/libraries. We have to maintain the
directory structure when installing the .hi files, rather than just
dumping them in a single directory as we do for packages in
fptools/hslibs.
|
|
|
|
| |
Also import FreeBSD's regex.h
|
|
|
|
| |
Include regex stuff if $(HavePosixRegex) == "NO"
|
|
|
|
|
| |
FreeBSD regex library requires reallocf(), a FreeBSD-specific flavour
of realloc(), so include it here.
|
|
|
|
|
|
|
| |
Remove support for "collate" which appears to be a locale-independent
way of interpreting character ranges like [a-z]. Anyway it relies on
stuff internal to FreeBSD's libc which doesn't appear to be easy to
extract, so just disable it.
|
|
|
|
| |
<regex.h> ==> "regex.h"
|
|
|
|
| |
Initial revision
|
|
|
|
| |
Import FreeBSD's regex library
|
|
|
|
| |
Time stubs (for mingw)
|
|
|
|
| |
Merge inputReady.c from ghc/lib/std
|
|
|
|
|
|
|
|
|
|
| |
Various updates after rearranging the directory structure in the
repository (there wasn't any history worth keeping, and it's better to
do this now before we go 'live').
Packages under 'compat' are backwards-compatibility packages which
should provide an interface equivalent to the current hslibs setup.
There are a few packages still missing.
|