A question:
/fptools/ghc/docs/users_guide/posix.vsgml says that:
> installHandler :: Signal
> -> Handler
> -> Maybe SignalSet -- other signals to block
> -> IO Handler -- old handler
> </verb></tscreen>
>
> @installHandler int handler iset@ calls @sigaction@ to install
> an interrupt handler for signal @int@. If @handler@ is
> @Default@, @SIG_DFL@ is installed; if @handler@ is
> @Ignore@, @SIG_IGN@ is installed; if @handler@ is
> @Catch action@, a handler is installed which will invoke @action@ as a
> replacement for @main@. If @iset@ is @Just s@, then the
> @sa_mask@ of the @sigaction@ structure is set to @s@;
> otherwise it is cleared. The previously installed signal handler for
> @int@ is returned.
Does this mean that there is no way to continue normal execution after a signal
has been received?
Put differently, I'd like the next program (which is
/fptools/ghc/misc/examples/posix/po008/Main.hs) to print the
"How did I get here?" string...
> import Posix
>
> main =
> installHandler realTimeAlarm (Catch alarmclock) Nothing >>
> putStr "Scheduling an alarm in 5 seconds...\n" >>
> scheduleAlarm 5 >>
> putStr "Sleeping one minute.\n" >>
> sleep 60 >>
> putStr "How did I get here?\n"
>
> alarmclock =
> putStr "The alarm went off.\n"
Isn't this behaviour different from the one found in C-land?
-- m
PS: By the way, there is something wrong with
http://www.dca.gla.ac.uk/mail-www/glasgow-haskell-users... The program that
converted the mail is a bit too egotistic!
-----------------------------------------------------------------------
Mariano Suarez Alvarez The introduction of
Departamento de Matematica numbers as coordinates
Universidad Nacional de Rosario [...] is an act of violence
Pellegrini 250 A. Weyl
2000 Rosario - Argentina
e-mail: [EMAIL PROTECTED]
-----------------------------------------------------------------------