Date: Tue, 26 Jan 1999 11:23:51 GMT
From: Toby Moth <firstname.lastname@example.org>
To: email@example.com, firstname.lastname@example.org
Subject: Re: Catching Break?
Ian T Zimmerman writes:
> Why doesn't this work:
> let main() =
> Sys.catch_break true;
> try Unix.kill (Unix.getpid()) Sys.sigint
> with Sys.Break -> prerr_endline "CAUGHT!"; exit 0
> let _ = main()
> This program just prints "Fatal error: Uncaught exception Sys.Break"
> as if the try block weren't there. Am I overlooking something really
On the other hand - if one hard-codes in a value for sigint..
let interrupt_handle _ = prerr_endline "Caught C-c"; exit 0;;
Sys.set_signal 2 ( Sys.Signal_handle interrupt_handle );
print_string "You have 10 seconds to stop me with C-c";
print_endline "You failed."
then everything works perfectly. I don't understand why there is
a discrepancy between the interrupt numbers in
sys.ml and those in /usr/include/sys/signal.h ?
On the other hand, I know next to nothing about these sorts of things.
This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:18 MET