Lines 74-84
__FBSDID("$FreeBSD$");
Link Here
|
74 |
*/ |
74 |
*/ |
75 |
#define BUFSIZE_SMALL (MAXPHYS) |
75 |
#define BUFSIZE_SMALL (MAXPHYS) |
76 |
|
76 |
|
77 |
static int |
77 |
static ssize_t |
78 |
copy_fallback(int from_fd, int to_fd, char *buf, size_t bufsize) |
78 |
copy_fallback(int from_fd, int to_fd, char *buf, size_t bufsize) |
79 |
{ |
79 |
{ |
80 |
int rcount; |
80 |
ssize_t rcount, wresid, wcount = 0; |
81 |
ssize_t wresid, wcount = 0; |
|
|
82 |
char *bufp; |
81 |
char *bufp; |
83 |
|
82 |
|
84 |
rcount = read(from_fd, buf, bufsize); |
83 |
rcount = read(from_fd, buf, bufsize); |
Lines 100-109
copy_file(const FTSENT *entp, int dne)
Link Here
|
100 |
static char *buf = NULL; |
99 |
static char *buf = NULL; |
101 |
static size_t bufsize; |
100 |
static size_t bufsize; |
102 |
struct stat *fs; |
101 |
struct stat *fs; |
103 |
ssize_t wcount; |
102 |
ssize_t rcount, wcount; |
104 |
size_t wresid; |
103 |
size_t wresid; |
105 |
off_t wtotal; |
104 |
off_t wtotal; |
106 |
int ch, checkch, from_fd, rcount, rval, to_fd; |
105 |
int ch, checkch, from_fd, rval, to_fd; |
107 |
char *bufp; |
106 |
char *bufp; |
108 |
#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED |
107 |
#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED |
109 |
char *p; |
108 |
char *p; |
Lines 236-242
copy_file(const FTSENT *entp, int dne)
Link Here
|
236 |
do { |
235 |
do { |
237 |
if (use_copy_file_range) { |
236 |
if (use_copy_file_range) { |
238 |
rcount = copy_file_range(from_fd, NULL, |
237 |
rcount = copy_file_range(from_fd, NULL, |
239 |
to_fd, NULL, bufsize, 0); |
238 |
to_fd, NULL, SSIZE_MAX, 0); |
240 |
if (rcount < 0 && errno == EINVAL) { |
239 |
if (rcount < 0 && errno == EINVAL) { |
241 |
/* Prob a non-seekable FD */ |
240 |
/* Prob a non-seekable FD */ |
242 |
use_copy_file_range = 0; |
241 |
use_copy_file_range = 0; |