Sha256: cd260ba9cbf455a73092cac64471e91a71300c7371577cb7e190d444872eb54b

Contents?: true

Size: 604 Bytes

Versions: 30

Compression:

Stored size: 604 Bytes

Contents

# frozen_string_literal: true

require 'ffi'

module Puma
  module JRubyRestart
    extend FFI::Library
    ffi_lib 'c'

    attach_function :execlp, [:string, :varargs], :int
    attach_function :chdir, [:string], :int
    attach_function :fork, [], :int
    attach_function :exit, [:int], :void
    attach_function :setsid, [], :int

    def self.chdir_exec(dir, argv)
      chdir(dir)
      cmd = argv.first
      argv = ([:string] * argv.size).zip(argv)
      argv.flatten!
      argv << :string
      argv << nil
      execlp(cmd, *argv)
      raise SystemCallError.new(FFI.errno)
    end
  end
end

Version data entries

30 entries across 30 versions & 3 rubygems

Version Path
jun-puma-1.0.1-java lib/puma/jruby_restart.rb
puma-6.4.3-java lib/puma/jruby_restart.rb
puma-6.4.3 lib/puma/jruby_restart.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/puma-6.4.2/lib/puma/jruby_restart.rb
puma-6.4.2-java lib/puma/jruby_restart.rb
puma-6.4.2 lib/puma/jruby_restart.rb
puma-6.4.1-java lib/puma/jruby_restart.rb
puma-6.4.1 lib/puma/jruby_restart.rb
puma-6.4.0-java lib/puma/jruby_restart.rb
puma-6.4.0 lib/puma/jruby_restart.rb
puma-6.3.1-java lib/puma/jruby_restart.rb
puma-6.3.1 lib/puma/jruby_restart.rb
puma-6.3.0-java lib/puma/jruby_restart.rb
puma-6.3.0 lib/puma/jruby_restart.rb
puma-6.2.2-java lib/puma/jruby_restart.rb
puma-6.2.2 lib/puma/jruby_restart.rb
puma-6.2.1-java lib/puma/jruby_restart.rb
puma-6.2.1 lib/puma/jruby_restart.rb
puma-6.2.0-java lib/puma/jruby_restart.rb
puma-6.2.0 lib/puma/jruby_restart.rb