version 1.2.4.1, 2021/11/10 09:07:20 |
version 1.3, 2021/11/28 19:28:42 |
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
*/ |
*/ |
|
|
#include <sys/param.h> /* MAXBSIZE */ |
#include <sys/types.h> |
|
|
#include <err.h> |
#include <err.h> |
#include <fcntl.h> |
#include <fcntl.h> |
|
|
|
|
#include "extern.h" |
#include "extern.h" |
|
|
|
#define _MAXBSIZE (64 * 1024) |
|
|
/* |
/* |
* Return true if all bytes in buffer are zero. |
* Return true if all bytes in buffer are zero. |
* A buffer of zero lenght is also considered a zero buffer. |
* A buffer of zero lenght is also considered a zero buffer. |
|
|
static int |
static int |
copy_internal(int fromfd, int tofd) |
copy_internal(int fromfd, int tofd) |
{ |
{ |
char buf[MAXBSIZE]; |
char buf[_MAXBSIZE]; |
ssize_t r, w; |
ssize_t r, w; |
|
|
while ((r = read(fromfd, buf, sizeof(buf))) > 0) { |
while ((r = read(fromfd, buf, sizeof(buf))) > 0) { |