Add preadv01 test for preadv() and pwritev() syscall
PATCH 1/1 Add preadv01 test for preadv() and pwritev() syscall
Quoted 8 lines · Gerd Hoffmann
Quoted 5 lines · Subrata Modak
Hi Gerd,
Thanks for writing preadv/pwritev syscalls for linux-2.6.30. We would
like to include your test code (hosted at:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=dac1213842f5caf081804a11d87d2a39a21d6f55) to be included in our Linux Test Project (http://ltp.sf.net) under GPLv2.
Quoted 5 lines
Fine with me.
Note that there was an ABI change
(http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=601cc11d054ae4b5e9b5babec3d8e4667a2cb9b5),
so the test program needs adaptions to the final ABI present in 2.6.30.
Ok. Great. Here is the patch which will integrate your test to LTP.
Original-author-and-copyright-holder: Gerd Hoffmann <[email protected]>
To: Gerd Hoffmann <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: ltp-list <[email protected]>
---
testcases/kernel/syscalls/preadv/Makefile +31 -0
@@ -0,0 +1,31 @@ +# +# Copyright (c) International Business Machines Corp., 2009 +# +# 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 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +CFLAGS += -I../../../../include -Wall -O2 +LDLIBS += -L../../../../lib -lltp + +SRCS = $(wildcard *.c) +TARGETS += $(patsubst %.c,%,$(SRCS)) + +all: $(TARGETS) + +install: + @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done + +clean: + rm -f $(TARGETS)
testcases/kernel/syscalls/preadv/preadv01.c +113 -0
113 lines not on this page · raw message
runtest/syscalls +2 -0
@@ -724,6 +724,8 @@ pread02_64 pread02_64 pread03 pread03 pread03_64 pread03_64 +preadv01 preadv01 + profil01 profil01 pselect01 pselect01
---
Regards--
Subrata
Quoted 4 lines
cheers,
Gerd
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Hi,
Quoted 1 line
+ * Reference: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=601cc11d054ae4b5e9b5babec3d8e4667a2cb9b5
Look at the commit message again ...
testcases/kernel/syscalls/preadv/preadv01.c line 43
Quoted 7 lines
testcases/kernel/syscalls/preadv/preadv01.c +7
-0+static ssize_t preadv (int fd,const struct iovec *iov,int iovcnt,off_t offset) +{ +uint32_t pos_high = (offset>>32 )&0xffffffff ; +uint32_t pos_low = offset&0xffffffff ; + +return syscall (__NR_preadv, fd, iov, iovcnt, pos_high, pos_low); +}
No.
#define HALF_BITS (sizeof(unsigned long)*4) return syscall(__NR_preadv, fd, iov, iovcnt, offset,
(offset >> HALF_BITS) >> HALF_BITS);
Likewise for pwritev.
Also note that latest glibc has preadv/pwritev support, so you could use that instead.
cheers,
Gerd
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 5 lines · Gerd Hoffmann
Hi,
Quoted 1 line
+ * Reference: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=601cc11d054ae4b5e9b5babec3d8e4667a2cb9b5
Look at the commit message again ...
Oops. I will fix that soon and resend.
Regards--
Subrata
Quoted 15 lines
testcases/kernel/syscalls/preadv/preadv01.c line 43
Quoted 8 lines
testcases/kernel/syscalls/preadv/preadv01.c +7
-0+static ssize_t preadv (int fd,const struct iovec *iov,int iovcnt,off_t offset) +{ +uint32_t pos_high = (offset>>32 )&0xffffffff ; +uint32_t pos_low = offset&0xffffffff ; + +return syscall (__NR_preadv, fd, iov, iovcnt, pos_high, pos_low); +}No.
#define
HALF_BITS(sizeof(unsigned long)*4) return syscall(__NR_preadv, fd, iov, iovcnt, offset,(offset >> HALF_BITS) >> HALF_BITS);
Quoted 8 lines
Likewise for pwritev.
Also note that latest glibc has preadv/pwritev support, so you could use that instead.
cheers,
Gerd
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list