repo.or.cz
/
jruby.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Fix for JRUBY-2882. Handle error messages related to constructors better
[jruby.git]
/
samples
/
ffi.rb
blob
3631016567b6adb11379cefe62677d1c552471e4
1
require 'ffi'
2
3
module POSIX
4
extend FFI::Library
5
# this line isn't really necessary since libc is always linked into JVM
6
ffi_lib 'c'
7
8
attach_function :getuid, :getuid, [], :uid_t
9
attach_function :getpid, :getpid, [], :pid_t
10
end
11
12
puts "Process #{POSIX.getpid} running as user #{POSIX.getuid}"