Please ignore this patch. I will send a V2 version where "#define _GNU_SOURCE" is added, thanks.
Regards, Xing Gu δΊ 05/26/2014 05:56 PM, Xing Gu ει: > Signed-off-by: Xing Gu <[email protected]> > --- > configure.ac | 1 + > m4/ltp-splice.m4 | 25 ++++ > runtest/syscalls | 1 + > testcases/kernel/syscalls/.gitignore | 1 + > testcases/kernel/syscalls/splice/splice.h | 36 ++++++ > testcases/kernel/syscalls/splice/splice01.c | 9 +- > testcases/kernel/syscalls/splice/splice02.c | 11 +- > testcases/kernel/syscalls/splice/splice03.c | 178 > ++++++++++++++++++++++++++++ > 8 files changed, 245 insertions(+), 17 deletions(-) > create mode 100644 m4/ltp-splice.m4 > create mode 100644 testcases/kernel/syscalls/splice/splice.h > create mode 100644 testcases/kernel/syscalls/splice/splice03.c > > diff --git a/configure.ac b/configure.ac > index 8698c47..96611cf 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -182,5 +182,6 @@ LTP_CHECK_FALLOCATE > LTP_CHECK_SYSCALL_FCNTL > LTP_CHECK_SYSCALL_PERF_EVENT_OPEN > LTP_CHECK_TIRPC > +LTP_CHECK_SPLICE > > AC_OUTPUT > diff --git a/m4/ltp-splice.m4 b/m4/ltp-splice.m4 > new file mode 100644 > index 0000000..0ddaae0 > --- /dev/null > +++ b/m4/ltp-splice.m4 > @@ -0,0 +1,25 @@ > +dnl > +dnl Copyright (c) Linux Test Project, 2014 > +dnl > +dnl This program is free software; you can redistribute it and/or modify > +dnl it under the terms of the GNU General Public License as published by > +dnl the Free Software Foundation; either version 2 of the License, or > +dnl (at your option) any later version. > +dnl > +dnl This program is distributed in the hope that it will be useful, > +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of > +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See > +dnl the GNU General Public License for more details. > +dnl > +dnl You should have received a copy of the GNU General Public License > +dnl along with this program; if not, write to the Free Software > +dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 > USA > +dnl > + > +dnl > +dnl LTP_CHECK_SPLICE > +dnl ---------------------------- > +dnl > +AC_DEFUN([LTP_CHECK_SPLICE],[ > +AC_CHECK_FUNCS(splice,,) > +]) > diff --git a/runtest/syscalls b/runtest/syscalls > index ae6d297..ea67137 100644 > --- a/runtest/syscalls > +++ b/runtest/syscalls > @@ -1151,6 +1151,7 @@ sockioctl01 sockioctl01 > #splice test > splice01 splice01 > splice02 seq 1 10000000 | splice02 splice02-temp > +splice03 splice03 > > tee01 tee01 > > diff --git a/testcases/kernel/syscalls/.gitignore > b/testcases/kernel/syscalls/.gitignore > index 825549f..f8460e8 100644 > --- a/testcases/kernel/syscalls/.gitignore > +++ b/testcases/kernel/syscalls/.gitignore > @@ -901,6 +901,7 @@ > /sockioctl/sockioctl01 > /splice/splice01 > /splice/splice02 > +/splice/splice03 > /ssetmask/ssetmask01 > /stat/stat01 > /stat/stat01_64 > diff --git a/testcases/kernel/syscalls/splice/splice.h > b/testcases/kernel/syscalls/splice/splice.h > new file mode 100644 > index 0000000..4e243fd > --- /dev/null > +++ b/testcases/kernel/syscalls/splice/splice.h > @@ -0,0 +1,36 @@ > +/* > + * Copyright (c) International Business Machines Corp., 2007 > + * Copyright (c) 2014 Fujitsu Ltd. > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; either version 2 of the License, or > + * (at your option) any later version. > + * > + * This program 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 Library General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. > + * > + */ > + > +#ifndef SPLICE_H > +#define SPLICE_H > + > +#include "config.h" > +#include "linux_syscall_numbers.h" > + > +#if !defined(HAVE_SPLICE) > +ssize_t splice(int fd_in, loff_t *off_in, int fd_out, > + loff_t *off_out, size_t len, unsigned int flags) > +{ > + return ltp_syscall(__NR_splice, fd_in, off_in, > + fd_out, off_out, len, flags); > +} > +#endif > + > +#endif /* SPLICE_H */ ------------------------------------------------------------------------------ Time is money. Stop wasting it! Get your web API in 5 minutes. www.restlet.com/download http://p.sf.net/sfu/restlet _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
