#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include <fcntl.h>
#include <limits.h>
#include <string.h>
#include <getopt.h>
{
unsigned char *buffer;
struct stat sb;
- long page_size;
- int i, ret;
+ int i;
if (parse_options(argc, argv) < 0)
return usage(argv[0]);
return 1;
}
- ret = fcntl(STDOUT_FILENO, F_GETPSZ);
- if (ret < 0)
- return error("F_GETPSZ");
-
- page_size = sysconf(_SC_PAGESIZE);
- if (page_size < 0)
- return error("_SC_PAGESIZE");
-
- fprintf(stderr, "Pipe size: %d pages / %ld bytes\n", ret, ret * page_size);
-
buffer = ALIGN(malloc(2 * SPLICE_SIZE + ALIGN_MASK));
for (i = 0; i < 2 * SPLICE_SIZE; i++)
buffer[i] = (i & 0xff);