[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[leafnode-list] sendfile (was Re: Permissions)



Matthias Andree wrote:

> krasel@xxxxxxxxxxxxxxxxxxxxxxxxxxxx (Cornelius Krasel) writes:
> 
> > I don't know anything about sendfile, but my manpage says:
> 
> sendfile requests that the kernel sends out a file to a file descriptor
> or copies a file from one descriptor to another, depending on the
> OS. The major plus is that this reduces copying which may help slow
> machines.
> 
> I know that at least Linux 2.2/2.4 and FreeBSD 4 support sendfile and
> I presume these two are most common for leafnode.

I agree. OTOH, I'd like to write a program that is compatible with as
many Unix variants as possible; however, I cannot find sendfile on
either Solaris 2.6, Tru64 or HP/UX (which are the three Unixes that
I can get a hand on). I think it is not a good idea to write a program
with extensions which themselves warn that they create incompatible
programs (and I think that's something which was actually taught to me
by Matthias :-).

I also don't think that the current method of transferring files (i.e.
getaline()/putaline()) is the bottleneck in speed. Even the NetBSD
ftp daemon uses getc() for reading files and sends them over the
network using putc() (when working in ascii mode), and it can easily
saturate a 10 MBit ethernet (we don't have 100 MBit in the building,
therefore I don't know about those). (The troll ftpd btw uses select()
for the same purpose.)

--Cornelius.

-- 
/* Cornelius Krasel, U Wuerzburg, Dept. of Pharmacology, Versbacher Str. 9 */
/* D-97078 Wuerzburg, Germany   email: krasel@xxxxxxxxxxxxxxxxxxxxxxxxxxxx */
/* "Science is the game we play with God to find out what His rules are."  */

-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list