Subject: | Why XSLoader does not treat dl_load_flags()? |
Hello,
There are some cases where I want to use dl_load_flags(), but XSLoader
seems not to treat dl_load_flags() currently.
The attached file, enable_dl_load_flags.patch, enables XSLoader to treat
dl_load_flags() as Dynaloader does. Please consider it.
Regards,
--
Goro Fuji (gfx) GFUJI at CPAN.org
Subject: | enable_dl_load_flags.patch |
*** XSLoader_pm.PL.orig Tue Feb 17 11:37:26 2009
--- XSLoader_pm.PL Tue Feb 17 11:39:35 2009
***************
*** 106,111 ****
--- 106,112 ----
}
print OUT <<'EOT';
+ my $flags = $module->can('dl_load_flags') ? $module->dl_load_flags : 0x00;
# Many dynamic extension loading problems will appear to come from
# this section of code: XYZ failed at line 123 of DynaLoader.pm.
# Often these errors are actually occurring in the initialisation
***************
*** 113,119 ****
# in this perl code simply because this was the last perl code
# it executed.
! my $libref = dl_load_file($file, 0) or do {
require Carp;
Carp::croak("Can't load '$file' for module $module: " . dl_error());
};
--- 114,120 ----
# in this perl code simply because this was the last perl code
# it executed.
! my $libref = dl_load_file($file, $flags) or do {
require Carp;
Carp::croak("Can't load '$file' for module $module: " . dl_error());
};