libs/nixio: protect splice calls with ifdef SPLICE_F_MOVE, fixes compile error with openwrt trunk x86/glibc

This commit is contained in:
Jo-Philipp Wich 2009-08-27 01:23:08 +00:00
parent 2c46f1058d
commit 30f881974c

View file

@ -39,11 +39,13 @@
#endif
#ifdef _GNU_SOURCE
#ifdef SPLICE_F_MOVE
/* guess what sucks... */
#ifdef __UCLIBC__
#include <unistd.h>
#include <sys/syscall.h>
ssize_t splice(int __fdin, __off64_t *__offin, int __fdout,
__off64_t *__offout, size_t __len, unsigned int __flags) {
#ifdef __NR_splice
@ -116,6 +118,7 @@ static int nixio_splice_flags(lua_State *L) {
return 1;
}
#endif /* SPLICE_F_MOVE */
#endif /* _GNU_SOURCE */
/**
@ -155,8 +158,10 @@ static int nixio_sendfile(lua_State *L) {
/* module table */
static const luaL_reg R[] = {
#ifdef _GNU_SOURCE
#ifdef SPLICE_F_MOVE
{"splice", nixio_splice},
{"splice_flags", nixio_splice_flags},
#endif
#endif
{"sendfile", nixio_sendfile},
{NULL, NULL}