Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

Fiddle::Handle.new

new(library = nil, flags = Fiddle::RTLD_LAZY | Fiddle::RTLD_GLOBAL)

Create a new handler that opens library with flags.

If no library is specified or nil is given, DEFAULT is used, which is the equivalent to RTLD_DEFAULT. See man 3 dlopen for more.

Example
lib = Fiddle::Handle.new

The default is dependent on OS, and provide a handle for all libraries already loaded. For example, in most cases you can use this to access libc functions, or ruby functions like rb_str_new.

See also .[] .sym .sym_defined? also in 3.4 · 3.2 · 3.1 · 3.0