splice.c (516B)
- // utils-std: Collection of commonly available Unix tools
- // SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
- // SPDX-License-Identifier: MPL-2.0
- // Because that's what our utilities will use :)
- #define _POSIX_C_SOURCE 200809L
- #define _GNU_SOURCE // for splice
- #include <fcntl.h> // splice
- #include <stdint.h> // SIZE_MAX
- #include <unistd.h> // ssize_t
- ssize_t
- test(int in, int out)
- {
- off_t in_pos = 0, out_pos = 0;
- return splice(in, &in_pos, out, &out_pos, SIZE_MAX, 0);
- }