Ruby by Examples
Ruby will retire its broken Kernel#syscall method in the future. In the current Ruby releases you cannot provide NUL octets to syscalls which breaks almost all syscalls using a struct to provide parameters to it (Ruby bug 1472). Luckily starting Ruby 1.9.2 there is Fiddle standard library that can be used to call foreign functions like C-library’s functions, including the wrappers for syscalls. Unfortunate part is that Fiddle is still (2.