Skip to content

Instantly share code, notes, and snippets.

@eam
Created October 11, 2016 21:33
Show Gist options
  • Save eam/6affef1ccd15217c09e6e17a65d30692 to your computer and use it in GitHub Desktop.
Save eam/6affef1ccd15217c09e6e17a65d30692 to your computer and use it in GitHub Desktop.
require 'ffi'
class IO
extend FFI::Library
ffi_lib 'c'
attach_function 'dup2', [:int, :int], :int
end
IO.dup2(3, 4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment