T12903.hs 255 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
import Control.Concurrent
import Control.Exception
import System.Posix

main = do
  pid <- forkProcess $ do
           handle (\UserInterrupt{} -> putStrLn "caught")
                  $ threadDelay 2000000
  signalProcess sigINT pid
  threadDelay 2000000