in reply to sysread/syswrite and O_DIRECT alignment problem

Perhaps perl is moving your buffer? Does getting a fresh buffer just before the sysread help? (perhaps using tye's suggestion above instead of mmap).

I don't know the pack "p" format very well, but using that to look at the address of $BUFFER appears to show it changing between the first syswrite and the last sysread.

Replies are listed 'Best First'.
Re^2: sysread/syswrite and O_DIRECT alignment problem
by fishnuts (Acolyte) on Nov 27, 2007 at 11:07 UTC
    I'll have to look into that, and see if it's really "reallocating" things. I'm fairly confident in my ability to keep track of variables/lists and their references in ways to mitigate leaks, but maybe this is unrelated.