libs/nixio: protect splice calls with ifdef SPLICE_F_MOVE, fixes compile error with openwrt trunk x86/glibc
This commit is contained in:
parent
2c46f1058d
commit
30f881974c
1 changed files with 5 additions and 0 deletions
|
@ -39,11 +39,13 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _GNU_SOURCE
|
#ifdef _GNU_SOURCE
|
||||||
|
#ifdef SPLICE_F_MOVE
|
||||||
|
|
||||||
/* guess what sucks... */
|
/* guess what sucks... */
|
||||||
#ifdef __UCLIBC__
|
#ifdef __UCLIBC__
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
|
|
||||||
ssize_t splice(int __fdin, __off64_t *__offin, int __fdout,
|
ssize_t splice(int __fdin, __off64_t *__offin, int __fdout,
|
||||||
__off64_t *__offout, size_t __len, unsigned int __flags) {
|
__off64_t *__offout, size_t __len, unsigned int __flags) {
|
||||||
#ifdef __NR_splice
|
#ifdef __NR_splice
|
||||||
|
@ -116,6 +118,7 @@ static int nixio_splice_flags(lua_State *L) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* SPLICE_F_MOVE */
|
||||||
#endif /* _GNU_SOURCE */
|
#endif /* _GNU_SOURCE */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -155,8 +158,10 @@ static int nixio_sendfile(lua_State *L) {
|
||||||
/* module table */
|
/* module table */
|
||||||
static const luaL_reg R[] = {
|
static const luaL_reg R[] = {
|
||||||
#ifdef _GNU_SOURCE
|
#ifdef _GNU_SOURCE
|
||||||
|
#ifdef SPLICE_F_MOVE
|
||||||
{"splice", nixio_splice},
|
{"splice", nixio_splice},
|
||||||
{"splice_flags", nixio_splice_flags},
|
{"splice_flags", nixio_splice_flags},
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
{"sendfile", nixio_sendfile},
|
{"sendfile", nixio_sendfile},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
|
|
Loading…
Reference in a new issue