-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal: handle CTRL+C properly w.r.t. Why3 server
For that purpose, we now start Why3 manually and connect to it as if it were an external Why3 server instance. The Why3 server is put in its own process groups and does not receive the signals (SIGINT, SIGTERM e.g.) directly received by EasyCrypt. The Why3 server is started s.t. it shutdowns itself gracefully when EasyCrypt disconnects from it.
- Loading branch information
Showing
5 changed files
with
127 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
(* -------------------------------------------------------------------- *) | ||
external setpgid : int -> int -> unit = "caml_eunix_setpgid" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
(* -------------------------------------------------------------------- *) | ||
val setpgid : int -> int -> unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* -------------------------------------------------------------------- */ | ||
#include <caml/mlvalues.h> | ||
#include <caml/memory.h> | ||
#include <caml/unixsupport.h> | ||
|
||
#include <unistd.h> | ||
|
||
/* -------------------------------------------------------------------- */ | ||
CAMLprim value caml_eunix_setpgid(value pid, value pgid) { | ||
CAMLparam2(pid, pgid); | ||
if (setpgid(Int_val(pid), Int_val(pgid)) != 0) | ||
uerror("setpgid", Nothing); | ||
CAMLreturn(Val_unit); | ||
} |