From 22a6087107820b8b658b434d2719d6ed1d741e5b Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Wed, 24 Oct 2012 19:53:39 -0700 Subject: [PATCH] unix.ffi: adding sendfile. --- basis/unix/ffi/linux/linux.factor | 2 ++ basis/unix/ffi/macosx/macosx.factor | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/basis/unix/ffi/linux/linux.factor b/basis/unix/ffi/linux/linux.factor index 94e42e224d..a28935feef 100644 --- a/basis/unix/ffi/linux/linux.factor +++ b/basis/unix/ffi/linux/linux.factor @@ -275,3 +275,5 @@ CONSTANT: SIGIO 29 ALIAS: SIGPOLL SIGIO CONSTANT: SIGPWR 30 CONSTANT: SIGSYS 31 + +FUNCTION: ssize_t sendfile ( int out_fd, int in_fd, off_t* offset, size_t count ) ; diff --git a/basis/unix/ffi/macosx/macosx.factor b/basis/unix/ffi/macosx/macosx.factor index 10d67d997b..6e994fbe82 100644 --- a/basis/unix/ffi/macosx/macosx.factor +++ b/basis/unix/ffi/macosx/macosx.factor @@ -264,3 +264,11 @@ CONSTANT: SIGWINCH 28 CONSTANT: SIGINFO 29 CONSTANT: SIGUSR1 30 CONSTANT: SIGUSR2 31 + +STRUCT: sf_hdtr + { headers iovec* } + { hdr_cnt int } + { trailers iovec* } + { trl_cnt int } ; + +FUNCTION: int sendfile ( int fd, int s, off_t offset, off_t* len, sf_hdtr* hdtr, int flags ) ;