Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Catching Break?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Ian T Zimmerman <itz@t...>
Subject: Catching Break?

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

Ocaml 2.01, Unix (Linux 2.0), libc5, linuxthreads.

Ian T Zimmerman                        <>
I came to the conclusion that what was wrong about the guillotine
was that the condemned man had no chance at all, absolutely none.
Albert Camus, _The Outsider_