[Haskell-cafe] Re: syscall, sigpause and EINTR on Mac OSX

Joel Reymont joelr1 at gmail.com
Sun Dec 11 18:52:19 EST 2005

On Dec 11, 2005, at 10:02 PM, Branimir Maksimovic wrote:

> Problem with mt programs is that they just appear to work but in  
> havy load
> situation those errors show once a while.

My loads are pretty heavy. Did not see any problems with SSL yet.

> This should be enough reason to scan  for keyboard events instead.
> There is no guarantee that SIGINT would be sent only by keyboard.

import System.Posix.Signals

main =
     do installHandler sigINT Ignore Nothing
        x <- getChar
        if x == '\ETX'
           then do print "Gotcha!"
           else do print "Try again!"

This does not work for ^C. Can it actually be done? Of course I can  
just read "q" but that would be too simple :-).

	Thanks, Joel


More information about the Haskell-Cafe mailing list