Skip to content

Commit

Permalink
macos support (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubwro authored Jul 9, 2024
1 parent 929be4c commit 0724663
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions shims/sigvisor.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
Expand Down
4 changes: 2 additions & 2 deletions src/Visor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ Return true if message is a `Request`.
"""
isrequest(message) = isa(message, Request)

if Sys.islinux()
if Sys.islinux() || Sys.isbsd()
function handle_signal(signo)::Int
if signo == 0 || signo == 2
shutdown()
Expand All @@ -1212,7 +1212,7 @@ function wait_signal(sv)
put!(sv.inbox, Shutdown())
end
catch
if Sys.islinux()
if Sys.islinux() || Sys.isbsd()
handle_ptr = @cfunction(handle_signal, Int, (Int,))
ccall(:signal, Int, (Int, Ptr{Cvoid}), 2, handle_ptr)
elseif Sys.iswindows()
Expand Down

0 comments on commit 0724663

Please sign in to comment.