| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now, we only set O_NONBLOCK on file descriptors that we create
ourselves. File descriptors that we inherit (stdin, stdout, stderr)
are kept in blocking mode. The way we deal with this differs between
the threaded and non-threaded runtimes:
- with -threaded, we just make a safe foreign call to read(), which
may block, but this is ok.
- without -threaded, we test the descriptor with select() before
attempting any I/O. This isn't completely safe - someone else
might read the data between the select() and the read() - but it's
a reasonable compromise and doesn't seem to measurably affect
performance.
|
| |
|
| |
|
|
|
|
| |
Merge to stable, checking for interface changes.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Fixes #637. The test program in that report now works for me with
-threaded, but it doesn't work without -threaded (I don't know if
that's new behaviour or not, though).
|
| |
|
| |
|
|
|
|
|
|
|
| |
The only remaining use is in cbits/dirUtils.h, which tests solaris2_HOST_OS
(Also System.Info uses ghcplatform.h and several modules import MachDeps.h
to get SIZEOF_* and ALIGNMENT_* from ghcautoconf.h)
|
|
|
|
|
|
|
|
|
| |
This patch imports the Data.ByteString.Lazy module, and its helpers,
providing a ByteString implemented as a lazy list of strict cache-sized
chunks. This type allows the usual lazy operations to be written on
bytestrings, including lazy IO, with much improved space and time over
the [Char] equivalents.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch brings Data.ByteString into sync with the FPS head.
The most significant of which is the new Haskell counting sort.
Changes:
Sun Apr 30 18:16:29 EST 2006 sjanssen@cse.unl.edu
* Fix foldr1 in Data.ByteString and Data.ByteString.Char8
Mon May 1 11:51:16 EST 2006 Don Stewart <dons@cse.unsw.edu.au>
* Add group and groupBy. Suggested by conversation between sjanssen and petekaz on #haskell
Mon May 1 16:42:04 EST 2006 sjanssen@cse.unl.edu
* Fix groupBy to match Data.List.groupBy.
Wed May 3 15:01:07 EST 2006 sjanssen@cse.unl.edu
* Migrate to counting sort.
Data.ByteString.sort used C's qsort(), which is O(n log n). The new algorithm
is O(n), and is faster for strings larger than approximately thirty bytes. We
also reduce our dependency on cbits!
|
| |
|
|
|
|
|
| |
Fast, packed byte vectors, providing a better PackedString.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apply rev 1.24 from FreeBSD's copy of this file. Commit message from
FreeBSD:
The algorithm that computes the tables used in the BM search
algorithm sometimes access an array beyond it's length. This only
happens in the last iteration of a loop, and the value fetched is
not used then, so the bug is a relatively innocent one. Fix this by
not fetching any value on the last iteration of said loop.
Submitted by: MKI <mki@mozone.net>
This is the cause of bug #1194393 (crash in darcs on Windows).
|
|
|
|
|
|
|
|
|
|
| |
waitForProcess: if the process died with a signal, just return the
exit status rather than EINTR.
This means a segfault shows up as (ExitFailure 139) rather than
an exception complaining about system call interruption. If the
client wants a more unix-ish interpretation, they probably should be
using System.Posix.Process anyway.
|
|
|
|
|
|
|
|
| |
On Windows, attach a finalizer to the ProcessHandle so that we can
call CloseHandle() when the handle is no longer in use. Previously we
were calling CloseHandle() in waitForProcess and terminateProcess,
which prevented making multiple calls to these functions on the same
handle.
|
|
|
|
|
|
| |
Fix
[ ghc-Bugs-1249226 ] runInteractiveProcess and closed stdin.
|
|
|
|
|
|
| |
check the return value of chdir()
[ 1242598 ] runProcess uses cwd for bad working directory argument
|
|
|
|
| |
flush_input_console__(): if the fd isn't connected to a console, treat flush as a NOP. Merge to STABLE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[mingw only]
Work around bug in win32 Console API which showed up in the GHCi UI:
if the user typed in characters prior to the appearance of the prompt,
the first of these characters always came out as a 'g'. The GHCi UI does
for good reasons one-character reads from 'stdin', which causes the
underlying APIs to become confused. A simple repro case is the following
piece of C code:
/*----------------------*/
#include <stdio.h>
#include <windows.h>
int main()
{
char ch1,ch2;
HANDLE hStdIn = GetStdHandle(STD_INPUT_HANDLE);
DWORD dw;
/* Type in some characters before the prompt appears and be amused.. */
sleep(1000); printf("? ");
ReadConsoleA(hStdIn,&ch1,1,&dw,NULL);
ReadConsoleA(hStdIn,&ch2,1,&dw,NULL);
/* or, if you want to use libc:
read(0,&ch1,1); read(0,&ch2,1); */
printf("%c%c\n", ch1,ch2);
return 0;
}
/*----------------------*/
This happens across win32 OSes, and I can't see anything untoward as far
as API usage goes (the GHC IO implementation uses read(), but that
reduces to ReadConsoleA() calls.) People inside the Behemoth might want
to have a closer look at this..
Not much we can do about this except work around the problem by flushing
the input buffer prior to reading from stdin. Not ideal, as type-ahead
is a useful feature. Flushing is handled by GHC.ConsoleHandler.flushConsole
Merge to STABLE.
|
|
|
|
|
|
|
|
|
|
| |
* Some preprocessors don't like the C99/C++ '//' comments after a
directive, so use '/* */' instead. For consistency, a lot of '//' in
the include files were converted, too.
* UnDOSified libraries/base/cbits/runProcess.c.
* My favourite sport: Killed $Id$s.
|
|
|
|
|
|
|
| |
__hscore_getFolderPath(): Don't limit ourselves to shell32.dll, look up
shfolder.dll too.
Merge to STABLE.
|
|
|
|
|
|
|
|
|
|
|
|
| |
[Windows only]
for System.Directory / Compat.Directory functionality that probes the OS
for local details re: misc user directories, perform late binding of
SHGetFolderPath() from shell32.dll, as it may not be present.
(cf. ghc-6.4's failure to operate on Win9x / NT boxes.) If the API isn't
there, fail with UnsupportedOperation.
Packages.readPackageConfigs: gracefully handle excns from getAppUserDataDirectory.
Merge to STABLE.
|
|
|
|
|
|
|
|
| |
HACK: The redirection of standard handles under Windows is a little bit tricky
because we have to take in account that the application can be GUI.
The commit affects only Windows GUI applications.
MERGE TO STABLE
|
|
|
|
| |
Back-port changes from WCsubst.c:iswprint()
|
|
|
|
| |
patch for iswprint() from Dimitry.
|
|
|
|
| |
Add the script used to generate WCsubst.c
|
|
|
|
|
| |
- isDigit only returns True for ASCII digits
- Export the new predicates from Data.Char
|
|
|
|
|
|
|
| |
Add Dimitry Golubovsky <dimitry@golubovsky.org>'s Unicode character
class implementation. This will remove the dependency on libc's
locale code and give us much more consistent support for Unicode
across platforms.
|
|
|
|
| |
merge rev. 1.4.2.1 to HEAD
|
|
|
|
| |
more regex test down to libraries/base
|
|
|
|
|
|
|
|
|
|
| |
Some improvements to System.Cmd.{system,rawSystem} on Un*x systems:
these commands now do the appropriate signal handling, namely ignoring
SIGINT/SIGQUIT in the parent but allowing these signals in the child.
This behaviour matches the Un*x system().
What this means is that when System.Cmd.system is executing, ^C only
kills the child process, the parent will see an exception.
|
|
|
|
|
|
|
|
| |
- The output from uncaught exceptions handler is redirected to RTS's errorBelch.
- The output from Debug.Trace is redirected to RTS's debugBelch
- Usually errorBelch and debugBelch messages go to stderr except for
Windows GUI applications. For GUI applications the Debug.Trace output is
redirected to debug console and the exceptions message is displayed in message box.
|
|
|
|
|
|
|
| |
Catch up with updates to platform #defines.
Generally: use _HOST_ rather than _TARGET_ (except in Cabal where we
have to retain compatibility with previous GHC versions).
|
|
|
|
|
| |
Win32: attempt to make inputReady() work on pipes too. Fixes bug
#995658.
|
|
|
|
|
|
|
|
| |
According to the documentation, the Haskell implementation of Handle
should implement single writer/multiple readers locking but the current
implementation doesn't work under Windows. This commit fixes this using
'_sopen' function instead of 'open'. The former allows to implement system
level locking on Windows. The changes doesn't affect other platforms.
|
|
|
|
|
| |
Move the compatibility code for rawSystem from libraries/base into
ghc/lib/compat.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Threaded RTS improvements:
- Unix only: implement waitRead#, waitWrite# and delay# in Haskell,
by having a single Haskell thread (the IO manager) performing a blocking
select() operation. Threads communicate with the IO manager
via channels. This is faster than doing the select() in the RTS,
because we only restart the select() when a new request arrives,
rather than each time around the scheduler.
On Windows we just make blocking IO calls, we don't have a fancy IO
manager (yet).
- Simplify the scheduler for the threaded RTS, now that we don't have
to wait for IO in the scheduler loop.
- Remove detectBlackHoles(), which isn't used now (not sure how long
this has been unused for... perhaps it was needed back when main threads
used to be GC roots, so we had to check for blackholes manually rather
than relying on the GC.)
Signals aren't quite right in the threaded RTS. In fact, they're
slightly worse than before, because the thread receiving signals might
be blocked in a C call - previously there always be another thread
stuck in awaitEvent() that would notice the signal, but that's not
true now. I can't see an easy fix yet.
|
|
|
|
|
| |
Bring declaration of runProcess back in line with prototype:
pid_t (ProcHandle) isn't compatible with int on SunOS.
|
|
|
|
| |
Update the signature of execvpe() to match the one in HsBase.
|
|
|
|
|
| |
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.
|