Hi
On Fri, 27 Jun 2008 20:47:01 +0100, kid joe wrote:
I'm wondering if it's possible to request a data transfer from one
device (given its device name and its offset and the transfer length) to
another file w/o reading in the data. I could do a fread() followed by
a fwrite() but I would love to have some sort of DMA-like function to do
this job.
That is quite a low level operation. The generic C FILE functions do not
let you do anything like that.
Most operating systems will not allow you direct control of DMA devices,
but if you are in a *nix environment, you can sometimes make reading and
writing to block devices more efficient by using the O_DIRECT flag to
open().
Alternatively you might be able to make certain file to file operations
on pipes or sockets quicker by using system calls like sendfile() or
splice().
HTH
viza