mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
Add support for sendfile() on Solaris.
This commit is contained in:
parent
49fb5f3fbf
commit
bea398d629
@ -20,7 +20,7 @@ bsd linux:
|
|||||||
make darkhttpd
|
make darkhttpd
|
||||||
|
|
||||||
solaris:
|
solaris:
|
||||||
make darkhttpd LIBS=-lxnet
|
make darkhttpd LIBS="-lxnet -lsendfile"
|
||||||
|
|
||||||
darkhttpd: darkhttpd.c
|
darkhttpd: darkhttpd.c
|
||||||
$(CC) $(CFLAGS) $(LIBS) darkhttpd.c -o darkhttpd
|
$(CC) $(CFLAGS) $(LIBS) darkhttpd.c -o darkhttpd
|
||||||
|
@ -33,6 +33,10 @@ static const int debug = 1;
|
|||||||
#include <sys/sendfile.h>
|
#include <sys/sendfile.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __sun__
|
||||||
|
#include <sys/sendfile.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -2041,7 +2045,7 @@ static ssize_t send_from_file(const int s, const int fd,
|
|||||||
}
|
}
|
||||||
else return size;
|
else return size;
|
||||||
#else
|
#else
|
||||||
#ifdef __linux
|
#if defined(__linux) || defined(__sun__)
|
||||||
return sendfile(s, fd, &ofs, size);
|
return sendfile(s, fd, &ofs, size);
|
||||||
#else
|
#else
|
||||||
#define BUFSIZE 20000
|
#define BUFSIZE 20000
|
||||||
|
Loading…
x
Reference in New Issue
Block a user