Subject: | sys_map missing fileno($fh) |
Thanks so much for writing this module. With it
I've finally been able to implement a cross-platform
memory-mapped IO for the Perl Data Language
(PDL)!
For compatibility with the original POSIX mmap
version, I used sys_map() rather than one of the
alternatives. In the process I found that there
appears to be a missing fileno($fh) conversion
in sys_map() before the call to _mmap_impl().
With that fix, everything appears to work. I would
appreciate if you could validate the fix and push
a new CPAN version as our PDL development
will need a working sys_map. :-)
Thanks much!
Chris
I've finally been able to implement a cross-platform
memory-mapped IO for the Perl Data Language
(PDL)!
For compatibility with the original POSIX mmap
version, I used sys_map() rather than one of the
alternatives. In the process I found that there
appears to be a missing fileno($fh) conversion
in sys_map() before the call to _mmap_impl().
With that fix, everything appears to work. I would
appreciate if you could validate the fix and push
a new CPAN version as our PDL development
will need a working sys_map. :-)
Thanks much!
Chris
Subject: | sys_map_fd_fix.patch |
diff -crB a/Map.pm b/Map.pm
*** a/Map.pm Mon Apr 2 17:46:19 2012
--- b/Map.pm Mon Apr 2 17:46:45 2012
***************
*** 111,117 ****
sub sys_map { ## no critic (ProhibitManyArgs)
my (undef, $length, $protection, $flags, $fh, $offset) = @_;
my $utf8 = _check_layers($fh);
! my $fd = ($flags & MAP_ANONYMOUS) ? $ANON_FH : $fh;
$offset ||= 0;
_mmap_impl($_[0], $length, $protection, $flags, $fd, $offset, $utf8);
return;
--- 111,117 ----
sub sys_map { ## no critic (ProhibitManyArgs)
my (undef, $length, $protection, $flags, $fh, $offset) = @_;
my $utf8 = _check_layers($fh);
! my $fd = ($flags & MAP_ANONYMOUS) ? $ANON_FH : fileno($fh);
$offset ||= 0;
_mmap_impl($_[0], $length, $protection, $flags, $fd, $offset, $utf8);
return;
Only in b: Map.pm~