in reply to sysread/syswrite and O_DIRECT alignment problem
Using mmap() just to get an aligned buffer seems like a bit of a sledgehammer and might be causing problems (though I don't have swapped in the implications of that particular use of mmap). You could try a different approach:
my $bufsize= 4096; my $align= 512; my $buf= 'x' x ($align+$bufsize); my $off= unpack( "J", pack "p", $buf ) % $align; $off= $align - $off if $off; sysread( $FH, $buf, $bufsize, $off ) or ...; my $data= substr( $buf, $off, $bufsize );
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: sysread/syswrite and O_DIRECT alignment problem (align)
by fishnuts (Acolyte) on Nov 27, 2007 at 11:04 UTC | |
by tye (Sage) on Nov 27, 2007 at 17:01 UTC | |
by fishnuts (Acolyte) on Nov 27, 2007 at 19:36 UTC | |
|
Re^2: sysread/syswrite and O_DIRECT alignment problem (align)
by dk (Chaplain) on Nov 27, 2007 at 14:55 UTC | |
by tye (Sage) on Nov 27, 2007 at 16:22 UTC |