within_sandbox: Check fork is supported
This commit is contained in:
parent
2dd1aef8a4
commit
810713d1e5
1 changed files with 2 additions and 0 deletions
|
@ -55,6 +55,8 @@ module Capsicum
|
|||
# @yield block to run within the forked child.
|
||||
# @return [Process::Status] exit status of the forked child.
|
||||
def within_sandbox
|
||||
raise NotImplementedError, "fork() not supported" unless Process.respond_to? :fork
|
||||
|
||||
return enum_for(:within_sandbox) unless block_given?
|
||||
|
||||
pid = fork do
|
||||
|
|
Loading…
Reference in a new issue