Compiling with -threaded under Solaris 10

Hi all, I'm trying to run the following program on Solaris 10 with GHC 6.4.1 (6.4.2 does not really work under Solaris 10 right now). module Main where import IO import Control.Concurrent import System.Process main = do (inp, out, err, ph) <- runInteractiveProcess "cat" [] Nothing Nothing forkIO (do hPutStr inp "this\nis\na\ntest\n" hClose inp) forkIO (do r <- hGetContents out putStr r) waitForProcess ph I compile it with $ ghc -o try Try2.hs -threaded -lrt When running, I get $ ./try try: waitForProcess: interrupted (Interrupted system call) and the program aborts. Under Linux, everything is fine. Do I have to set some macros explicitly? And if so, which ones? Any help appreciated. Best regards, Florian

Florian Lorenzen schrieb:
I'm trying to run the following program on Solaris 10 with GHC 6.4.1 (6.4.2 does not really work under Solaris 10 right now).
What did you try out with ghc-6.4.2? ghc-6.4.2 does not work _because_ of -threaded. And this inability certainly applies to ghc-6.4.1 as well.
$ ghc -o try Try2.hs -threaded -lrt
A couple of bugs have been fixed in cvs. You may try out my binary distribution at: http://www.informatik.uni-bremen.de/agbkb/forschung/formal_methods/CoFI/hets... Your example works for me. Cheers Christian -bash-3.00$ ghc -o try Try2.hs -threaded -bash-3.00$ ldd try librt.so.1 => /lib/librt.so.1 libm.so.2 => /usr/local/lib/libm.so.2 libgmp.so.3 => /usr/local/lib/libgmp.so.3 libdl.so.1 => /lib/libdl.so.1 libpthread.so.1 => /lib/libpthread.so.1 libc.so.1 => /lib/libc.so.1 libaio.so.1 => /lib/libaio.so.1 libmd5.so.1 => /lib/libmd5.so.1 libm.so.2 => /lib/libm.so.2 /platform/SUNW,Sun-Fire-280R/lib/libc_psr.so.1 /platform/SUNW,Sun-Fire-280R/lib/libmd5_psr.so.1 -bash-3.00$ ./try this is a test

Christian Maeder schrieb:
Your example works for me.
It seemed to work for me even for ghc-6.4.1 (on a sparc)! -bash-3.00$ ./try this is a test -bash-3.00$ ./try try: waitForProcess: interrupted (Interrupted system call) Several times trying using ghc-6.4.2 also revealed errors: -bash-3.00$ ./try this is a test -bash-3.00$ ./try -bash-3.00$ ./try -bash-3.00$ ./try -bash-3.00$ Namely, producing no output. Cheers Christain
participants (2)
-
Christian Maeder
-
Florian Lorenzen