diff --git a/TODO b/TODO index 81391e4..828184c 100644 --- a/TODO +++ b/TODO @@ -7,6 +7,7 @@ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/cre http://www.sysinternals.com/ntw2k/info/comport.shtml +http://msdn.microsoft.com/msdnmag/issues/1000/winsock/default.aspx Solaris 9: http://docs.sun.com/db/doc/816-5218/6mbcj7nrr?q=sendfile&a=view @@ -14,3 +15,4 @@ Solaris 9: http://docs.sun.com/db/doc/816-5218/6mbcj7nrr?q=sendfile&a=view HP-UX: http://docs.hp.com/hpux/onlinedocs/B9106-90009/00/01/168-con.html AIX: http://publib16.boulder.ibm.com/pseries/en_US/libs/commtrf2/send_file.htm + diff --git a/havealloca.h b/havealloca.h index 444371c..369fdba 100644 --- a/havealloca.h +++ b/havealloca.h @@ -1,3 +1,3 @@ -#if defined(__linux__) || defined(_SGI_SOURCE) || defined(__hpux__) +#if defined(__linux__) || defined(_SGI_SOURCE) || defined(__hpux__) || defined(__sun__) #include #endif diff --git a/io/io_sendfile.c b/io/io_sendfile.c index 591bef0..a50cb73 100644 --- a/io/io_sendfile.c +++ b/io/io_sendfile.c @@ -53,6 +53,19 @@ int64 io_sendfile(int64 s,int64 fd,uint64 off,uint64 n) { int64 io_sendfile(int64 out,int64 in,uint64 off,uint64 bytes) { return sendfile64(out,in,off,bytes,0,0); } + +#elif defined (__sun__) && defined(__svr4__) + +#define _LARGEFILE64_SOURCE +#include +#include +#include + +int64 io_sendfile(int64 out,int64 in,uint64 off,uint64 bytes) { + off64_t o=off; + return sendfile64(out,in,&o,bytes); +} + #endif #else diff --git a/trysendfile.c b/trysendfile.c index 13c3e86..53fd2ac 100644 --- a/trysendfile.c +++ b/trysendfile.c @@ -19,6 +19,17 @@ int main() { x, 0); perror("sendfile"); } +#elif defined (__sun__) && defined(__svr4__) +#include +#include +#include + +int main() { + off_t o; + o=0; + sendfile(1 /* dest */, 0 /* src */,&o,23 /* nbytes */); + perror("sendfile"); +} #else #error unsupported architecture #endif