From: Ollivier Robert Date: 2009-01-19T20:23:44+09:00 Subject: Re: [FFI] how to bind to a function with variable number of args In article , Luc Heinrich wrote: >This would be defined like this: The following does not work: ----- module LibC extend FFI::Library attach_function :setproctitle, [:string, :varargs], :void end LibC.setproctitle("Ruby: executing %s", [:string, $0]) ----- Same error: /opt/local/lib/ruby/gems/1.8/gems/ffi-0.2.0/lib/ffi/library.rb:65:in `attach_function': Function 'setproctitle' not found in [[current process]] (FFI::NotFoundError) from proc.rb:12 (OS X, 10.5.6, Ruby from MacPorts) UPDATE: setproctitle may not be available in OS X. Retrying on FreeBSD leads to this: /usr/local/lib/ruby/gems/1.8/gems/ffi-0.2.0/lib/ffi/types.rb:18:in `find_type': Unable to resolve type 'stringproc.rb' (FFI::TypeError) from /usr/local/lib/ruby/gems/1.8/gems/ffi-0.2.0/lib/ffi/variadic.rb:23:in `call' from (eval):3:in `setproctitle' from proc.rb:15 -- Ollivier ROBERT -=- EEC/RIF/SEU -=- Systems Engineering Unit