CLEANUP: remove support for USE_MY_SPLICE

The splice() syscall has been supported in glibc since version 2.5 issued
in 2006 and is present on supported systems so there's no need for having
our own arch-specific syscall definitions anymore.
This commit is contained in:
Willy Tarreau 2020-03-10 07:20:10 +01:00
parent 3858b122a6
commit 06c63aec95
4 changed files with 1 additions and 99 deletions

View File

@ -16,7 +16,6 @@
# USE_EPOLL : enable epoll() on Linux 2.6. Automatic.
# USE_KQUEUE : enable kqueue() on BSD. Automatic.
# USE_EVPORTS : enable event ports on SunOS systems. Automatic.
# USE_MY_SPLICE : redefine the splice syscall if build fails without.
# USE_NETFILTER : enable netfilter on Linux. Automatic.
# USE_PCRE : enable use of libpcre for regex. Recommended.
# USE_PCRE_JIT : enable JIT for faster regex on libpcre >= 8.32
@ -282,7 +281,7 @@ LDFLAGS = $(ARCH_FLAGS) -g
#### list of all "USE_*" options. These ones must be updated if new options are
# added, so that the relevant options are properly added to the CFLAGS and to
# the reported build options.
use_opts = USE_EPOLL USE_KQUEUE USE_MY_SPLICE USE_NETFILTER \
use_opts = USE_EPOLL USE_KQUEUE USE_NETFILTER \
USE_PCRE USE_PCRE_JIT USE_PCRE2 USE_PCRE2_JIT USE_POLL \
USE_PRIVATE_CACHE USE_THREAD USE_PTHREAD_PSHARED USE_BACKTRACE \
USE_STATIC_PCRE USE_STATIC_PCRE2 USE_TPROXY USE_LINUX_TPROXY \

View File

@ -1,77 +0,0 @@
/*
* include/common/splice.h
* Splice definition for older Linux libc.
*
* Copyright 2000-2011 Willy Tarreau <w@1wt.eu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, version 2.1
* exclusively.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef _COMMON_SPLICE_H
#define _COMMON_SPLICE_H
#if defined (__linux__) && defined(USE_LINUX_SPLICE)
#include <errno.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <common/syscall.h>
/* On recent Linux kernels, the splice() syscall may be used for faster data copy.
* But it's not always defined on some OS versions, and it even happens that some
* definitions are wrong with some glibc due to an offset bug in syscall().
*/
#ifndef SPLICE_F_MOVE
#define SPLICE_F_MOVE 0x1
#endif
#ifndef SPLICE_F_NONBLOCK
#define SPLICE_F_NONBLOCK 0x2
#endif
#ifndef SPLICE_F_MORE
#define SPLICE_F_MORE 0x4
#endif
#if defined(USE_MY_SPLICE)
/* We'll define a syscall, so for this we need __NR_splice. It should have
* been provided by syscall.h.
*/
#ifndef __NR_splice
#warning unsupported architecture, guessing __NR_splice=313 like x86...
#define __NR_splice 313
#endif /* __NR_splice */
static inline _syscall6(int, splice, int, fdin, loff_t *, off_in, int, fdout, loff_t *, off_out, size_t, len, unsigned long, flags);
#else
/* use the system's definition */
#include <fcntl.h>
#endif /* USE_MY_SPLICE */
#endif /* __linux__ && USE_LINUX_SPLICE */
#endif /* _COMMON_SPLICE_H */
/*
* Local variables:
* c-indent-level: 8
* c-basic-offset: 8
* End:
*/

View File

@ -80,25 +80,6 @@
/* Define some syscall numbers that are sometimes needed */
/* splice is even more recent than epoll. It appeared around 2.6.18 but was
* not in libc for a while.
*/
#ifndef __NR_splice
#if defined(__powerpc__) || defined(__powerpc64__)
#define __NR_splice 283
#elif defined(__sparc__) || defined(__sparc64__)
#define __NR_splice 232
#elif defined(__x86_64__)
#define __NR_splice 275
#elif defined(__alpha__)
#define __NR_splice 468
#elif defined (__i386__)
#define __NR_splice 313
#elif defined(__s390__) || defined(__s390x__)
#define __NR_splace 306
#endif /* $arch */
#endif /* __NR_splice */
#endif /* __linux__ */
#endif /* _COMMON_SYSCALL_H */

View File

@ -43,7 +43,6 @@
#if defined(USE_LINUX_SPLICE)
#include <common/splice.h>
/* A pipe contains 16 segments max, and it's common to see segments of 1448 bytes
* because of timestamps. Use this as a hint for not looping on splice().