Luc Heinrich
1/17/2009 10:31:00 AM
On 16 janv. 09, at 18:00, Ollivier Robert wrote:
> I'm looking at ruby-ffi 0.2.0 with MRI 1.8.7 (haven't tried with
> rubinius yet) and I can get to attach to setproctitle(3) defined like
> this:
>
> void
> setproctitle(const char *fmt, ...);
This would be defined like this:
module LibC
extend FFI::Library
attach_function : setproctitle, [:string, :varargs], :void
end
And then used like this:
LibC.setproctitle("%d-%d", [:string, "foo", :int, 42])
--
Luc Heinrich - luc@honk-honk.com