static int same_file;
static int splice_size = SPLICE_SIZE;
static char *filename = "splice-file";
-static int max_client_run = 15;
+static unsigned int max_client_run = 15;
static int run_rw = 1;
static int run_splice = 1;
static int run_mmap = 1;
int sk, opt;
bind_to_cpu(offset);
- nice(-20);
+ if (nice(-20) < 0)
+ perror("nice");
sk = socket(PF_INET, SOCK_STREAM, 0);
if (sk < 0)
off = 0;
do {
- int ret = splice(fd, &off, pfd[1], NULL, min(size, (unsigned long long) splice_size), 0);
+ int ret = ssplice(fd, &off, pfd[1], NULL, min(size, (unsigned long long) splice_size), 0);
if (ret <= 0)
return error("splice-in");
size -= ret;
while (ret > 0) {
int flags = size ? SPLICE_F_MORE : 0;
- int written = splice(pfd[0], NULL, out_fd, NULL, ret, flags);
+ int written = ssplice(pfd[0], NULL, out_fd, NULL, ret, flags);
if (written <= 0)
return error("splice-out");
char fname[64];
bind_to_cpu(offset);
- nice(-20);
+ if (nice(-20) < 0)
+ perror("nice");
if (!write_to_null)
out_fd = client_open_net(offset);