copy_file_range.c (489B)
- // utils-std: Collection of commonly available Unix tools
- // SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
- // SPDX-License-Identifier: MPL-2.0
- // For copy_file_range
- #define _GNU_SOURCE // musl, glibc
- #define _DEFAULT_SOURCE // FreeBSD
- #include <stdint.h> // SIZE_MAX
- #include <sys/types.h>
- #include <unistd.h>
- ssize_t
- test(int in, int out)
- {
- off_t in_pos = 0, out_pos = 0;
- return copy_file_range(in, &in_pos, out, &out_pos, SIZE_MAX, 0);
- }