summaryrefslogtreecommitdiff
path: root/libraries/base/cbits
Commit message (Collapse)AuthorAgeFilesLines
...
* [project @ 2004-09-29 15:46:53 by simonmar]simonmar2004-09-291-113/+0
| | | | Move this to the Attic
* [project @ 2004-09-01 09:47:31 by simonmar]simonmar2004-09-011-1/+5
| | | | | | | | | | | | | 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.
* [project @ 2004-08-16 11:08:47 by simonmar]simonmar2004-08-161-2/+2
| | | | wibble
* [project @ 2004-08-16 11:07:31 by simonmar]simonmar2004-08-162-2/+6
| | | | | More ugly hacks related to the config.h change. I'm beginning to think maybe this wasn't such a great idea.
* [project @ 2004-08-16 09:31:15 by simonmar]simonmar2004-08-161-1/+8
| | | | #ifdefery to work around change in name of config.h
* [project @ 2004-08-13 13:29:00 by simonmar]simonmar2004-08-133-3/+3
| | | | | Changes required be merge of backend-hacking-branch. Mostly config.h ==> ghcconfig.h.
* [project @ 2004-07-23 15:31:59 by ross]ross2004-07-235-117/+4
| | | | | To make Text.Regex.Posix work with Hugs, move cbits/regex/regex.h under include, where Hugs can find it.
* [project @ 2004-06-02 12:35:11 by simonmar]simonmar2004-06-021-6/+21
| | | | | | | | | | | | | | 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
* [project @ 2004-02-12 21:23:48 by krasimir]krasimir2004-02-121-8/+3
| | | | | | 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.
* [project @ 2004-02-04 17:13:53 by ross]ross2004-02-041-1/+1
| | | | plug a warning
* [project @ 2004-01-06 12:40:00 by simonmar]simonmar2004-01-061-16/+0
| | | | | | | | | | | | | | | 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
* [project @ 2003-12-04 18:25:51 by panne]panne2003-12-041-1/+1
| | | | Synched #ifdefs, but only 90% sure if I got it right...
* [project @ 2003-11-21 16:24:44 by sof]sof2003-11-211-10/+7
| | | | code tidyup
* [project @ 2003-11-05 09:58:01 by simonmar]simonmar2003-11-051-1/+5
| | | | | | | | 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
* [project @ 2003-10-20 13:16:58 by simonmar]simonmar2003-10-201-1/+2
| | | | Comment use of $(HavePosixRegex)
* [project @ 2003-10-13 05:21:37 by sof]sof2003-10-132-3/+3
| | | | more mind-numbing CPP tweaking
* [project @ 2003-09-24 11:06:54 by simonmar]simonmar2003-09-241-65/+0
| | | | | | | | 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.
* [project @ 2003-09-23 16:18:03 by sof]sof2003-09-231-3/+9
| | | | [win32]: make it compile
* [project @ 2003-09-21 22:20:57 by wolfgang]wolfgang2003-09-211-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* [project @ 2003-09-03 10:49:19 by simonmar]simonmar2003-09-031-1/+1
| | | | | inputReady(): the time calculation for select() was wrong, forgetting to multiply the milliseconds value by 1000 to get microseconds.
* [project @ 2003-08-23 00:08:02 by sof]sof2003-08-231-8/+41
| | | | | | | [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'.
* [project @ 2003-08-01 15:56:11 by panne]panne2003-08-011-1/+1
| | | | Warning police
* [project @ 2003-07-10 19:25:58 by sof]sof2003-07-101-0/+70
| | | | | | | | | | | 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.
* [project @ 2003-07-02 13:27:35 by stolz]stolz2003-07-021-2/+2
| | | | fork() never returns with EINTR
* [project @ 2003-06-18 08:06:00 by stolz]stolz2003-06-181-1/+1
| | | | fork() never returns with EINTR
* [project @ 2003-06-12 16:06:06 by simonmar]simonmar2003-06-121-10/+22
| | | | | | | | | | | | | | | | | | | | | 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.
* [project @ 2003-02-04 11:55:54 by simonmar]simonmar2003-02-041-1/+9
| | | | | | | 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.
* [project @ 2002-12-13 14:23:42 by simonmar]simonmar2002-12-131-5/+5
| | | | | Fix bugs caused by missing casts in arithmetic expressions in stg_integerToInt64 and stg_integerToWord64.
* [project @ 2002-09-25 15:24:07 by simonmar]simonmar2002-09-251-595/+1
| | | | | | | | | | | | | | 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...)
* [project @ 2002-08-28 13:59:19 by simonmar]simonmar2002-08-281-0/+122
| | | | | | | - 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.
* [project @ 2002-07-23 22:04:36 by sof]sof2002-07-231-5/+4
| | | | | | | 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.)
* [project @ 2002-07-18 22:01:07 by sof]sof2002-07-182-1/+72
| | | | helper functions for mucking about with Win32 consoles
* [project @ 2002-07-04 13:33:24 by simonmar]simonmar2002-07-041-0/+9
| | | | | | | | | | | | 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.
* [project @ 2002-03-26 21:02:19 by sof]sof2002-03-261-2/+2
| | | | cygwin: stick with system()
* [project @ 2002-03-25 05:23:53 by sof]sof2002-03-251-0/+4
| | | | provide isblank() for Win32
* [project @ 2002-03-19 11:24:51 by simonmar]simonmar2002-03-191-6/+6
| | | | | | | | | | | | | | | 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.
* [project @ 2002-02-15 11:28:47 by simonpj]simonpj2002-02-153-51/+51
| | | | Remove __P from prototypes
* [project @ 2002-02-15 11:27:03 by simonpj]simonpj2002-02-151-8/+15
| | | | | - include <sys/types.h> rather than non-std <sys/cdefs.h> - remove use of __P-style prototypes
* [project @ 2002-02-15 11:26:02 by simonpj]simonpj2002-02-151-0/+5
| | | | mingw32 doesn't define _POSIX2_RE_DUP_MAX, it seems
* [project @ 2002-02-14 15:14:02 by simonmar]simonmar2002-02-141-2/+1
| | | | | | | 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.
* [project @ 2002-02-14 14:07:16 by simonmar]simonmar2002-02-141-0/+106
| | | | Also import FreeBSD's regex.h
* [project @ 2002-02-14 14:05:48 by simonmar]simonmar2002-02-141-1/+8
| | | | Include regex stuff if $(HavePosixRegex) == "NO"
* [project @ 2002-02-14 14:05:12 by simonmar]simonmar2002-02-141-0/+39
| | | | | FreeBSD regex library requires reallocf(), a FreeBSD-specific flavour of realloc(), so include it here.
* [project @ 2002-02-14 14:03:25 by simonmar]simonmar2002-02-141-1/+7
| | | | | | | 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.
* [project @ 2002-02-14 14:01:38 by simonmar]simonmar2002-02-144-4/+4
| | | | <regex.h> ==> "regex.h"
* [project @ 2002-02-14 13:59:21 by simonmar]simonmar2002-02-146-0/+3729
| | | | Initial revision
* [project @ 2002-02-14 13:59:20 by simonmar]simonmar2002-02-145-0/+531
| | | | Import FreeBSD's regex library
* [project @ 2002-02-14 07:31:03 by sof]sof2002-02-141-0/+15
| | | | Time stubs (for mingw)
* [project @ 2002-02-13 12:21:21 by simonmar]simonmar2002-02-131-44/+43
| | | | Merge inputReady.c from ghc/lib/std
* [project @ 2002-02-07 11:13:29 by simonmar]simonmar2002-02-077-14/+14
| | | | | | | | | | 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.