sendfile_freebsd.c (475B)
- // utils-std: Collection of commonly available Unix tools
- // SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
- // SPDX-License-Identifier: 0BSD
- #define _DEFAULT_SOURCE
- #include <sys/socket.h>
- #include <sys/types.h>
- #include <sys/uio.h>
- #include <stddef.h> // NULL
- ssize_t
- test(int in, int out, size_t len)
- {
- off_t offset = 0;
- off_t sbytes = 0;
- struct sf_hdtr *hdtr = NULL;
- return sendfile(in, out, offset, len, hdtr, &sbytes, 0);
- }