Skip to content

Commit

Permalink
Rename send_signal to signal
Browse files Browse the repository at this point in the history
  • Loading branch information
patricoferris committed Feb 21, 2023
1 parent 944664c commit f6bdf04
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib_eio_linux/eio_linux.ml
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ module Low_level = struct
t.hook <- hook;
t

let send_signal t i = pidfd_send_signal (FD.to_unix `Peek t.process) i
let signal t i = pidfd_send_signal (FD.to_unix `Peek t.process) i
end
end

Expand Down
5 changes: 3 additions & 2 deletions lib_eio_linux/eio_linux.mli
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ module Low_level : sig
(** [wait t] waits for the process [t] to exit. This blocks the fiber until the process
has finished. *)

val send_signal : t -> int -> unit
(** A wrapper for {!Unix.kill}. *)
val signal : t -> int -> unit
(** [signal t s] send a signal [s] to process [t]. For example to stop a process you could use
[signal t Sys.sigkill]. *)
end
end
4 changes: 2 additions & 2 deletions lib_eio_linux/tests/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Stopping a process works.
# Eio_linux.run @@ fun _env ->
Switch.run @@ fun sw ->
let t = Process.spawn ~sw "sleep" [ "sleep"; "10" ] in
Process.send_signal t Sys.sigkill;
Process.signal t Sys.sigkill;
Process.wait t;;
- : Unix.process_status = Unix.WSIGNALED (-7)
```
Expand All @@ -95,7 +95,7 @@ Stopping a process interacts nicely with switches.
let proc =
Switch.run @@ fun sw ->
let t = Process.spawn ~sw "sleep" [ "sleep"; "10" ] in
Process.send_signal t Sys.sigkill;
Process.signal t Sys.sigkill;
t
in
Process.wait proc;;
Expand Down

0 comments on commit f6bdf04

Please sign in to comment.