summaryrefslogtreecommitdiff
path: root/ext/fiddle
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fiddle')
-rw-r--r--ext/fiddle/handle.c11
-rw-r--r--ext/fiddle/lib/fiddle.rb5
2 files changed, 13 insertions, 3 deletions
diff --git a/ext/fiddle/handle.c b/ext/fiddle/handle.c
index 832ff3319a..357ff0510c 100644
--- a/ext/fiddle/handle.c
+++ b/ext/fiddle/handle.c
@@ -113,10 +113,15 @@ predefined_fiddle_handle(void *handle)
/*
* call-seq:
- * new(lib = nil, flags = Fiddle::RTLD_LAZY | Fiddle::RTLD_GLOBAL)
+ * 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, RTLD_DEFAULT is used, which
+ * usually means +libc+.
+ *
+ * libc = Fiddle::Handle.new
*
- * Create a new handler that opens library named +lib+ with +flags+. If no
- * library is specified, RTLD_DEFAULT is used.
*/
static VALUE
rb_fiddle_handle_initialize(int argc, VALUE argv[], VALUE self)
diff --git a/ext/fiddle/lib/fiddle.rb b/ext/fiddle/lib/fiddle.rb
index c8a7ef1b05..3a9b5d5bff 100644
--- a/ext/fiddle/lib/fiddle.rb
+++ b/ext/fiddle/lib/fiddle.rb
@@ -32,6 +32,11 @@ module Fiddle
# Creates a new handler that opens +library+, and returns an instance of
# Fiddle::Handle.
#
+ # If +nil+ is given for the +library+, Fiddle::Handle::DEFAULT is used, which
+ # usually means +libc+.
+ #
+ # libc = Fiddle.dlopen(nil)
+ #
# See Fiddle::Handle.new for more.
def dlopen library
Fiddle::Handle.new library