Linux and sendfile

Jason Stephenson jason at sigio.com
Tue Oct 29 16:55:00 EST 2002


The usual semantics is when it returns < count, then you're done, 
assuming you're trying to copy everything from in_fd to out_fd. It 
wouldn't hurt to keep calling it, you just need to make sure that you 
don't end up in an infinite loop.

Jeff Macdonald wrote:
> Hi all,
> I'm hoping there are some fellow programmers here that have used the
> sendfile system call. What I'm wondering is should I treat sendfile like
> write when the out_fd is a socket. By that, I mean even if I specifiy N
> count bytes, sendfile might only send < N bytes and if it does, I should
> call sendfile again.
> 
> Here's the prototype:
> ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count);
> 
> 
> 
> 
> _______________________________________________
> gnhlug-discuss mailing list
> gnhlug-discuss at mail.gnhlug.org
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
> 




More information about the gnhlug-discuss mailing list