Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. 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 #[] also in 3.4 · 3.3 · 3.2 · 3.1