さかいといいます。

現在のRuby/DLではdlopenの第一引数に0を指定する方法はないようですが、
http://docs.sun.com/db/doc/816-0213/6m6ne37t2?a=view
によると、

| If the value of pathname is 0, dlopen() provides a handle on
| a  global symbol object.  This object provides access to the
| symbols from an ordered set of  objects  consisting  of  the
| original  program image file, together with any dependencies
| loaded at program startup, and any objects that were  loaded
| using  dlopen()  together with the RTLD_GLOBAL flag.  As the
| latter set of objects can change during  process  execution,
| the set identified by handle can also change dynamically.

とのことなので、Ruby/DLでも0を指定する方法があると嬉しいです。

# とりあえず手元ではこんなパッチを当てて使っています。

Index: handle.c
===================================================================
RCS file: /src/ruby/ext/dl/handle.c,v
retrieving revision 1.10
diff -u -p -r1.10 handle.c
--- handle.c	  29 Mar 2003 02:56:18 -0000	1.10
+++ handle.c	  13 Oct 2003 13:38:25 -0000
@@ -52,11 +52,11 @@ rb_dlhandle_initialize(int argc, VALUE a
 
   switch (rb_scan_args(argc, argv, "11", &lib, &flag)) {
   case 1:
-    clib = StringValuePtr(lib);
+    clib = NIL_P(lib) ? NULL : StringValuePtr(lib);
     cflag = RTLD_LAZY | RTLD_GLOBAL;
     break;
   case 2:
-    clib = StringValuePtr(lib);
+    clib = NIL_P(lib) ? NULL : StringValuePtr(lib);
     cflag = NUM2INT(flag);
     break;
   default:

--
酒井 政裕 / Masahiro Sakai