diff --git a/io/io_sendfile.c b/io/io_sendfile.c index 27590ee..000246d 100644 --- a/io/io_sendfile.c +++ b/io/io_sendfile.c @@ -43,6 +43,31 @@ int64 io_sendfile(int64 out,int64 in,uint64 off,uint64 bytes) { return sendfile64(out,in,&o,bytes); } +#elif defined(_AIX) + +#include +#include +#include +#include + +int64 io_sendfile(int64 out,int64 in,uint64 off,uint64 bytes) { + struct sf_parms p; + int destfd=out; + p.header_data=0; + p.header_length=0; + p.file_descriptor=in; + p.file_offset=off; + p.file_bytes=bytes; + p.trailer_data=0; + p.trailer_length=0; + if (send_file(&destfd,&p,0)>=0) + return p.bytes_sent; + if (errno==EAGAIN) + return -1; + else + return -3; +} + #elif defined(__linux__) #if defined(__GLIBC__) diff --git a/t.c b/t.c index 68aece6..ca72be0 100644 --- a/t.c +++ b/t.c @@ -36,6 +36,9 @@ int main(int argc,char* argv[]) { buffer_putnlflush(buffer_1); buffer_put(buffer_1,buf,fmt_ip6ifc(buf,blubip,scope_id)); buffer_putnlflush(buffer_1); + scan_ip6("2001:7d0:0:f015:0:0:0:1",ip); + buffer_put(buffer_1,buf,fmt_ip6(buf,ip)); + buffer_putnlflush(buffer_1); #if 0 char buf[100]; int i;