Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

22 lines
411 B

  1. /* for macos X, don't ask */
  2. #define SENDFILE 1
  3. #include <sys/types.h>
  4. #include <sys/socket.h>
  5. #include <sys/uio.h>
  6. #include <errno.h>
  7. #include <netinet/in.h>
  8. #include <netinet/tcp.h>
  9. int main() {
  10. struct sf_hdtr hdr;
  11. struct iovec v[17+23];
  12. int r,fd=1;
  13. off_t sbytes;
  14. hdr.headers=v; hdr.hdr_cnt=17;
  15. hdr.trailers=v+17; hdr.trl_cnt=23;
  16. r=sendfile(0,1,37,42,&hdr,&sbytes,0);
  17. (void)r;
  18. return 0;
  19. }