home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-05-01 | 985 b | 27 lines | [TEXT/MPS ] |
- (* Operations on Unix signals. *)
-
- (* Action taken on receipt of a signal: *)
-
- type signal_handler =
- Signal_default (* Default behavior for the signal *)
- | Signal_ignore (* Ignore the signal *)
- | Signal_raise of exn (* Raise the given exception value
- when the signal occurs. *)
- ;;
-
- value SIGHUP : int (* The "hang up" signal *)
- and SIGINT : int (* The "break" signal *)
- and SIGFPE : int (* The "arithmetic error" signal *)
- ;;
-
- value set_signal : int -> signal_handler -> unit = 2 "set_signal"
- (* "set_signal n h" sets the action taken on receipt of signal n
- to h. *)
- ;;
- value protect : ('a -> 'b) -> 'a -> 'b
- (* "protect f x" applies f to x and returns the result,
- ignoring all signals during the evaluation of f x.
- Useful to implement atomic actions. *)
- ;;
-
-