stevefolder/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/getpid.rb
2022-02-04 18:48:09 -05:00

9 lines
146 B
Ruby

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