summaryrefslogtreecommitdiff
path: root/samples/getpid.rb
blob: 1720635bc52c8c2d543d26b98b363abe2011dc09 (plain)
1
2
3
4
5
6
7
8
require 'ffi'

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