From: Laurent Julliard Date: 2001-07-28T00:32:24+09:00 Subject: [ruby-talk:18638] Accessing argc,argv,environ from a ruby extension? I'm puzzled by this one. I'm writing a Ruby extension in C and I need to access the C global variables argc, argv and environ from the intialization function of my Ruby extension. Problem is eventhough I declared these 3 variables as extern in my C file it looks like Ruby doesn't export these variables. Looking at the ruby symbol table ruby uses origargc, origargv and origenviron which are probably what I'm looking for but unfortunately they are static variable declared not visible from the outside ("b" data type on the nm -o output). Am I missing something here or is this specific to Ruby 1.6.4 on Linux ? To work around the problem, I ended up rebuilding my own argc, argv from the $* Ruby variable. However I couldn't rebuild environ from the ENV Standard Ruby object because I have not found a way to access the ENV object from a C extension (rb_gv_get doesn't work). Any idea ? Thanks for your help Laurent