summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-26 05:06:57 +0000
committerzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-26 05:06:57 +0000
commit6bb201d6d1d44ac2c376a20125caf4be849579df (patch)
tree68ff6c7bd2664bf93a162eb0480e50863c334078
parent45c4d828233898f4164aaabca6dfb68a38e04a57 (diff)
* ext/fiddle/*: [DOC] More doc on dlopen and RTLD_DEFAULT from r42186
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--ext/fiddle/handle.c9
-rw-r--r--ext/fiddle/lib/fiddle.rb8
3 files changed, 16 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 495b89b0c45..81189fd8e34 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Fri Jul 26 14:05:19 2013 Zachary Scott <e@zzak.io>
+
+ * ext/fiddle/*: [DOC] More doc on dlopen and RTLD_DEFAULT from r42186
+
Fri Jul 26 13:08:53 2013 Zachary Scott <e@zzak.io>
* ext/fiddle/lib/fiddle.rb: [DOC] Document Fiddle.dlopen(nil)
diff --git a/ext/fiddle/handle.c b/ext/fiddle/handle.c
index 357ff0510c3..330dbafe67c 100644
--- a/ext/fiddle/handle.c
+++ b/ext/fiddle/handle.c
@@ -117,11 +117,14 @@ predefined_fiddle_handle(void *handle)
*
* 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+.
+ * If no +library+ is specified or +nil+ is given, DEFAULT is used, which is
+ * the equivalent to RTLD_DEFAULT. See <code>man 3 dlopen</code> for more.
*
- * libc = Fiddle::Handle.new
+ * 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+.
*/
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 3a9b5d5bffa..ae6e299637c 100644
--- a/ext/fiddle/lib/fiddle.rb
+++ b/ext/fiddle/lib/fiddle.rb
@@ -33,9 +33,13 @@ module Fiddle
# Fiddle::Handle.
#
# If +nil+ is given for the +library+, Fiddle::Handle::DEFAULT is used, which
- # usually means +libc+.
+ # is the equivalent to RTLD_DEFAULT. See <code>man 3 dlopen</code> for more.
#
- # libc = Fiddle.dlopen(nil)
+ # lib = Fiddle.dlopen(nil)
+ #
+ # 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 Fiddle::Handle.new for more.
def dlopen library