actually check in AIX sendfile code

master
leitner 21 years ago
parent cae1a561fd
commit c18a0dbf62

@ -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 <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <errno.h>
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__)

3
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;

Loading…
Cancel
Save