But the output is a network socket. If you want to send
DATA
blahblahblah
.
And blahblahblah comes from a file (which, when it was being input, had all
. quoted to ..), then you can do a sendfile() which will send one packet if
you have the ability to add headers and trailers.
Or, you have to do a write()/writev(), sendfile(), write()/writev(), which
ends up (possibly) sending 3 packets. I'm assuming the actual 'file' will
be much larger than this, but the 2 packet overhead remains.
And if you're a web server or proxy server, and have some headers followed
by a file, you don't want to break things up into one more packet unless
you have to - it makes it slower going over the end user's slow little
modem link and use more CPU time at both ends, etc (not to mention an extra
syscall which has a trivial, but not non-existant, cost).
I don't know if the ability to add extra data is a good or bad thing
really. Maybe the strongest point for implementing it is that it is
then more similar to the HP-UX (and NT) syscall, which means it isn't
completely Linux-specific.
David.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu