lkml.org 
[lkml]   [1998]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [patch] sendfile in fileutils
On Thu, 17 Dec 1998, Andrea Arcangeli wrote:

>I' ve done a little patch to fileutils to allow me to do zero copy inside
>`cp` and `dd`.

woops, sendfile is not generic enough to cope with devices in /dev/. This
little _incremental_ patch is needed:

--- copy.c~ Thu Dec 17 22:58:13 1998
+++ copy.c Thu Dec 17 22:58:59 1998
@@ -340,17 +340,8 @@
} else /* sendfile */ {
off_t offset = 0;
int retval;
- switch ((retval = sendfile(dest_desc, source_desc, &offset, sb.st_size)))
- {
- case -ENOSYS:
+ if (sendfile(dest_desc, source_desc, &offset, sb.st_size) < 0)
goto no_zero_copy;
- default:
- if (retval < 0)
- {
- error (0, errno, "%s", dst_path);
- return_val = -1;
- }
- }
}
ret:
if (close (dest_desc) < 0)

Andrea Arcangeli


-
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/

\
 
 \ /
  Last update: 2005-03-22 13:46    [W:0.285 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site