Re: sendfile() (Was Re: Thread Implementations)

Richard Jones (rjones@orchestream.com)
Wed, 24 Jun 1998 15:58:23 +0000


Amsden, Zachary wrote:
>
> I've read up a bit on TransmitFile() and the NT
> implementations, I think there is a better and
> more general solution than TransmitFile(). I
> have an idea which would have a great many uses
> as far as programming efficiency.
>
> Consider the asynchronous kernel call
> int connectfd(int fd1, int fd2, int options)
>
> fd1 must have read permissions, and fd2 must
> have write permissions.

Even better, what about:

ssize_t copy (int from_fd, int to_fd, size_t nbytes);

A first cut implementation of this is really trivial -
just a loop in the kernel. Later, ambitious hackers
could optimize various things like from_fd == file,
to_fd == socket (becomes TransmitFile equivalent,
and perhaps does I2O or DMA hackery); and from_fd == file
on NFS, to_fd == file on NFS is optimized to send a
COPYFILE primitive to the server.

It's simple, the semantics are obvious, non-blocking
works like you expect and so on.

Rich.

-- 
Richard Jones rjones@orchestream.com Tel: +44 171 598 7557 Fax: 460 4461
Orchestream Ltd.  125 Old Brompton Rd. London SW7 3RP PGP: www.four11.com
"boredom ... one of the most overrated emotions ... the sky is made
of bubbles ..."   Original message content Copyright © 1998

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu