logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git

sendfile_freebsd.c (475B)


  1. // utils-std: Collection of commonly available Unix tools
  2. // SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. // SPDX-License-Identifier: 0BSD
  4. #define _DEFAULT_SOURCE
  5. #include <sys/socket.h>
  6. #include <sys/types.h>
  7. #include <sys/uio.h>
  8. #include <stddef.h> // NULL
  9. ssize_t
  10. test(int in, int out, size_t len)
  11. {
  12. off_t offset = 0;
  13. off_t sbytes = 0;
  14. struct sf_hdtr *hdtr = NULL;
  15. return sendfile(in, out, offset, len, hdtr, &sbytes, 0);
  16. }