Re: sendfile from char device?

2001-02-19 Thread Matthew Kirkwood
On Mon, 19 Feb 2001, Jeff Garzik wrote: > > But, unfortunately, sendfile (in 2.2 and 2.4) appears not > > to support sendfile(2)ing a device: > > Correct... sendfile(2) is only for sources/destinations that can be > ripped through the page cache. I knew that, but was surprised that /dev/zero did

Re: sendfile from char device?

2001-02-19 Thread Jeff Garzik
On Mon, 19 Feb 2001, Matthew Kirkwood wrote: > I'm looking for a fast way to initialise a file to zeroes > (without holes) and reckoned that sendfile from /dev/zero > would be the way to go. > > But, unfortunately, sendfile (in 2.2 and 2.4) appears not > to support sendfile(2)ing a device: Corre

sendfile from char device?

2001-02-19 Thread Matthew Kirkwood
Hi, I'm looking for a fast way to initialise a file to zeroes (without holes) and reckoned that sendfile from /dev/zero would be the way to go. But, unfortunately, sendfile (in 2.2 and 2.4) appears not to support sendfile(2)ing a device: $ cat foo.c main() { if(sendfile(1, 0, 0, 1024) <