Skip to content

Instantly share code, notes, and snippets.

@headius
Created May 14, 2009 05:04
Show Gist options
  • Save headius/111495 to your computer and use it in GitHub Desktop.
Save headius/111495 to your computer and use it in GitHub Desktop.
require 'ffi'
module Exec
extend FFI::Library
attach_function :my_exec, :execl, [:string, :string, :varargs], :int
attach_function :fork, [], :int
end
vim1 = '/usr/bin/vim'
vim2 = 'vim'
if Exec.fork == 0
Exec.my_exec vim1, vim2, :pointer, nil
end
Process.waitall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment