in reply to Re: sysread/syswrite and O_DIRECT alignment problem
in thread sysread/syswrite and O_DIRECT alignment problem
The solution Tye provided worked well, and took advantage of the "offset" argument to sysread/syswrite, which I previously thought wasn't necessary... Once you know "how far out of alignment" a scalar variable is, you just pass around that offset and use it wherever you need to align the buffer for sysread/syswrite, and use substr to extract or inject your working data from/to that buffer.