splice.h 784 B

1234567891011121314151617181920212223242526
  1. #include <syscall.h>
  2. #include <bits/types.h>
  3. #include <bits/stdio.h>
  4. #define SPLICE_F_MOVE (1<<0)
  5. #define SPLICE_F_NONBLOCK (1<<1)
  6. #define SPLICE_F_MORE (1<<2)
  7. #define SPLICE_F_GIFT (1<<3)
  8. inline static long sys_splice(int fdin, uint64_t* offin, int fdout,
  9. uint64_t* offout, size_t len, unsigned flags)
  10. {
  11. return syscall6(NR_splice, fdin, (long)offin, fdout, (long)offout,
  12. len, flags);
  13. }
  14. inline static long sys_tee(int fdin, int fdout, size_t len, unsigned flags)
  15. {
  16. return syscall4(NR_tee, fdin, fdout, len, flags);
  17. }
  18. inline static long sys_sendfile(int ofd, int ifd, uint64_t* offset, size_t count)
  19. {
  20. return syscall4(NR_sendfile, ofd, ifd, (long)offset, count);
  21. }