1 // SPDX-License-Identifier: GPL-2.0
12 int main(int argc
, char *argv
[])
19 fprintf(stderr
, "Usage: %s INPUT [BYTES]\n", argv
[0]);
23 fd
= open(argv
[1], O_RDONLY
);
34 if (fstat(fd
, &statbuf
) < 0) {
39 if (statbuf
.st_size
> INT_MAX
) {
40 fprintf(stderr
, "%s: Too big\n", argv
[1]);
44 size
= statbuf
.st_size
;
47 /* splice(2) file to stdout. */
48 spliced
= splice(fd
, NULL
, STDOUT_FILENO
, NULL
,