| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
compile execvpe only under Unix. The mingw's process.h header also contains
definition for execvpe which conflicts with our definition.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Process reorganisation: the System.Process library moves into base,
and System.Cmd is re-implemented in terms of it.
Thanks to Krasimir Angelov, we have a version of System.Process that
doesn't rely on the unix or Win32 libraries. Normally using
unix/Win32 would be the right thing, but since we want to implement
System.Cmd on top of this, and GHC uses System.Cmd, we can't introduce
a bunch of .hsc dependencies into GHC's bootstrap libraries.
So, the new version is larger, but has fewer dependencies. I imagine
it shouldn't be too hard to port to other compilers.
|
|
|
|
|
|
|
|
| |
- Remove configure tests for SIG{POLL,INFO,WINCH}:
Testing via #ifdef SIGFOO should be sufficient.
- Change #if HAVE_SIGPOLL to #ifdef SIGPOLL
- Remove SIGINFO/WINCH from package base: they'll reappear in package unix
in System/Posix/Signals.Exts.
|
|
|
|
|
|
|
| |
Add cpp-protected signals sigINFO & sigWINCH if available.
(An autoconf-wizard might want to look at the bottom of configure.ac, the
similarities between HAVE_SIGPOLL, HAVE_SIGINFO & HAVE_SIGWINCH can surely
be factored out)
|
|
|
|
| |
devolve the recently added dirent checks to a new libraries/base/configure.ac
|
|
|
|
|
|
|
|
| |
__hscore_d_name(), __hscore_end_of_dir(): de-platformify and use
feature #defines instead.
[Should anyone see compilation breakages stemming from HsBase.h as a result
of this commit, remember to 'autoreconf' in FPTOOLS_TOP and re-make.]
|
|
|
|
| |
Be resistant to missing CSIDL_* defines
|
|
|
|
| |
add getUserDocumentsDirectory function
|
|
|
|
| |
Add getHomeDirectory and getAppUserDataDirectory functions
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changes related to arithmetic types:
* Renamed macros NUMERIC_FOO to ARITHMETIC_FOO to match C99-speak
* ARITHMETIC_TYPEs now have a Real instance, otherwise they are quite useless.
Note that this differs from the FFI spec, but the spec should very probably
changed in this respect.
* Some changes to fix the wrong assumption that CTime/CClock are integral types,
C99 in fact guarantees only that they are arithmetic types. This has been
accomplished by using
realToInteger = round . realToFrac :: Real a => a -> Integer
instead of fromIntegral for CTime/CClock. I'm not sure if we could do better,
going via Double seems to be overkill, but I couldn't think of a better way.
GHC could e.g. use RULES here. Improvements welcome.
|
|
|
|
| |
__hscore_PrelHandle_{send,recv}: make these mingw32-only
|
|
|
|
| |
Add __hscore_PrelHandle_{send,recv}
|
|
|
|
|
| |
Implemented renaming for Data.Typeable according to
http://www.haskell.org//pipermail/libraries/2004-March/001846.html
|
|
|
|
| |
Comments (and deleted some of the blank lines Ralf is so fond of).
|
|
|
|
|
|
| |
clean up the TypeableN stuff a bit: GHC uses overlapping instances;
everyone else uses explicit instances using provided defaults.
Macros paper over the difference.
|
|
|
|
| |
stat() needs to be wrapped too
|
|
|
|
| |
Also need to wrap fstat().
|
|
|
|
|
|
|
| |
Use C wrappers for lseek() and open(). On Linux, these functions are
macro'd to different versions when large file support is on, so to
make the libraries compilable with the NCG we need to use C wrappers
for these functions.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Hugs only: use the configure-set variable INLINE_ONLY instead of
`extern inline' (which works for gcc but not C99 compilers).
|
|
|
|
| |
__hscore_set_errno() should return void, not int.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
- Fix up mingw build after changes to hGetBuf etc.
I don't think that hGetBufNonBlocking works correctly on Windows,
because there doesn't seem to be a non-blocking read primitive. I
haven't tested it, however.
- Clean up Unix versions of the low-level read/write functions in
Handle.hs. Now that these aren't used on Windows, they can be
made simpler.
|
|
|
|
|
|
| |
* Added workaround for broken sigemptyset
* Use #if, not #ifdef for feature tests
* Nuked CVS keyword
|
|
|
|
|
|
|
| |
Added an extremely ugly workaround for the broken sigfillset macro on
OpenBSD, which misses a cast. Is there a better way?
Probably merge to STABLE.
|
|
|
|
| |
drop uses of __MINGW32__, no longer needed
|
|
|
|
| |
unswap UNBLOCK/SETMASK (merge to STABLE)
|
|
|
|
| |
prev commit too strict wrt mingw
|
|
|
|
| |
make it useable with msvc + gcc-mingw
|
|
|
|
|
| |
To fix dynamic linking issues with Hugs, access saved_termios via
getter/setter.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
If we change the terminal settings as a result of hSetBuffering or
hSetEcho, then restore them again in hs_exit(). This is just good
citizenship on Unixy platforms.
We *don't* just automatically save the terminal settings and restore
them at the end, because that would prevent implementing stty-like
programs in Haskell. This scheme is a compromise that hopefully DTRT
in most cases.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
| |
Move setChildStopFlag and queryChildStopFlag to System.Posix.Signals.
|
|
|
|
|
|
|
| |
Deal with systems on which PATH_MAX is undefined, e.g. systems with
unlimited path length, like the Hurd (also faulty installations of gcc
on Solaris). In fact getCurrentDirectory only needs a long path size
to use as a first approximation, so give it that.
|
|
|
|
|
| |
Nuked FPTOOLS_O_BINARY test and use FP_CHECK_CONST instead, which is
shorter and better (e.g. cross compilation).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use the wide-char classifications from the C library if available.
This gives us Unicode-aware isLower, isUpper, isAlpha etc.
On Unix, you have to set your locale to something. This is usually
done by setting the environment variable LANG, eg.
export LANG=en
This stuff *should* also work on Windows, except that Windows uses a
16-bit wchar_t so will get it wrong for characters > '\xffff'. However,
I figured it was better to use the system-supplied functionality
rather than trying to implement this stuff ourselves.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Major refactoring of Data/Generics.
This also affects the compiler (because of deriving issues).
This is an intermediate commit.
The library is supposed to compile fine.
But the deriving stuff for Data needs to be revised.
The testsuite for Data/Generics will not pass.
gread is broken at the moment.
So it is strongly recommended not to cvs upd for a few hours or a day.
Detailed description of changes:
- Split up Data/Dynamic into Data/Typeable and Data/Dynamic.
(This makes clear what part is about TypeReps and cast vs.
dynamics. The latter is not needed by Data/Generics.)
- Renamed Data/include/Dynamic.h -> Typeable.h to end confusion.
- Split up Data/Generics.hs in a set of modules.
- Revised class Data:
- Got rid of gunfold but added fromConstr as more primtive one
- Revised representations of constructors
- Revised treatment of primitive types
- Revised type of gmapQ; preserved old gmapQ as gmapL
- Added a module Data/Types.hs for treatment of types as values.
This is going somewhere.
|
|
|
|
|
| |
GCC 3.3 is a bit picky about macros with a varying number of
arguments, even when they are skipped. Strange...
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
avoid a C compiler warning about arithmetic with void *
|
|
|
|
| |
Hugs only: use the whole thing now
|
|
|
|
| |
Comment wibble
|
|
|
|
| |
Only interested in a subset when used in w/ Hugs
|
|
|
|
|
|
|
|
|
| |
Make the new Posix bindings compile on Mac OS X.
Most notable, Mac OS X lacks
*) lchown
*) SIGPOLL
I don't know of a replacement of either, so they are just left out when
they are not detected by configure.
|
|
|
|
|
| |
Warning police #6: Add prototype for writeErrString__, which is used
by GHC.TopHandler.
|
|
|
|
|
| |
Warning police #4: To use uname, we should try to #include
<sys/utsname.h>.
|