summaryrefslogtreecommitdiffhomepage
path: root/libs/nixio/src/splice.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-08-27 01:23:08 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-08-27 01:23:08 +0000
commit30f881974cd25ff5b430545db7152cab021e9cd6 (patch)
treec350365b994020d3e0405f532dc9f87a097ccd34 /libs/nixio/src/splice.c
parent2c46f1058da3021ed8b07a7936f6c469d31b65a8 (diff)
libs/nixio: protect splice calls with ifdef SPLICE_F_MOVE, fixes compile error with openwrt trunk x86/glibc
Diffstat (limited to 'libs/nixio/src/splice.c')
-rw-r--r--libs/nixio/src/splice.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/nixio/src/splice.c b/libs/nixio/src/splice.c
index 0704dfd24f..fe56661632 100644
--- a/libs/nixio/src/splice.c
+++ b/libs/nixio/src/splice.c
@@ -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,9 +158,11 @@ 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}
};