On Friday 10 Sep 2004 15:52, Andrew Walrond wrote:
>
> Actually, now I went away and checked out what you meant by ext/dl, I'll be
> using that. What a great feature (that I never knew about)!
>

And, of course, it worked flawlessly ;) Thanks for the tip!

require "dl/import"
module LIBC
  extend DL::Importable
  dlload "libc.so.6"
  extern "int reboot(int)"
end

module Kernel
  #See man (2) reboot
  def poweroff(); LIBC.reboot(0x4321fedc); end
  def reboot(); LIBC.reboot(0x01234567); end
  def halt(); LIBC.reboot(0xcdef0123); end
  def cad(enable); LIBC.reboot(enable ? 0x89abcdef : 0); end
end