summaryrefslogtreecommitdiff
path: root/testsuite/tests/lib/libposix/posix009.hs
blob: 1f230f648c5adec6936c02dffd8350b6ef394ba5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import Posix

main =
    putStr "Blocking real time alarms.\n" >>
    blockSignals (addSignal realTimeAlarm emptySignalSet) >>
    putStr "Scheduling an alarm in 2 seconds...\n" >>
    scheduleAlarm 2 >>
    putStr "Sleeping 5 seconds.\n" >>
    sleep 5 >>
    putStrLn "Woken up" >>
    getPendingSignals >>= \ ints ->
    putStr "Checking pending interrupts for RealTimeAlarm\n" >>
    print (inSignalSet realTimeAlarm ints) >>
    putChar '\n'