That is not a problem in Linux. Get used to TCP_CORK:
int optval = 1;
off_t off;
setsockopt(sock, SOL_TCP, TCP_CORK, &optval, sizeof(int));
/* Write header */
write (sock, header, sizeof(header);
/* Send one file infd1 */
off = 0;
sendfile (sock, infd1, &off, size1);
/* Send yet another file infd2 */
off = 0;
sendfile (sock, infd2, &off, size2);
/* Now flush partial frame */
optval = 0;
setsockopt(sock, SOL_TCP, TCP_CORK, &optval, sizeof(int));
(of course, this lacks any error handling etc., but you get the picture).
Cheers,
Jakub
___________________________________________________________________
Jakub Jelinek | jj@sunsite.mff.cuni.cz | http://sunsite.mff.cuni.cz
Administrator of SunSITE Czech Republic, MFF, Charles University
___________________________________________________________________
UltraLinux | http://ultra.linux.cz/ | http://ultra.penguin.cz/
Linux version 2.3.1 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/