rf-web/vendor/bundle/gems/ffi-1.11.1/samples/getpid.rb
2019-10-21 10:18:17 +02:00

9 lines
164 B
Ruby

require 'rubygems'
require 'ffi'
module Foo
extend FFI::Library
ffi_lib FFI::Library::LIBC
attach_function :getpid, [ ], :int
end
puts "My pid=#{Foo.getpid}"