support HP-UX sendfile (thanks Rolf Eike Beer)
parent
8ce9e6c016
commit
f484ecdc5f
@ -0,0 +1,24 @@
|
||||
#ifdef __hpux__
|
||||
#include <sys/types.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
int main() {
|
||||
/*
|
||||
sbsize_t sendfile(int s, int fd, off_t offset, bsize_t nbytes,
|
||||
const struct iovec *hdtrl, int flags);
|
||||
*/
|
||||
struct iovec x[2];
|
||||
int fd=open("havesendfile.c",0);
|
||||
x[0].iov_base="header";
|
||||
x[0].iov_len=6;
|
||||
x[1].iov_base="footer";
|
||||
x[1].iov_len=6;
|
||||
sendfile(1 /* dest socket */,fd /* src file */,
|
||||
0 /* offset */, 23 /* nbytes */,
|
||||
x, 0);
|
||||
perror("sendfile");
|
||||
}
|
||||
#else
|
||||
#error unsupported architecture
|
||||
#endif
|
Loading…
Reference in New Issue