summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorDamir Shayhutdinov <damir@altlinux.ru>2011-05-12 16:57:40 +0400
committerDmitry V. Levin <ldv@altlinux.org>2011-05-30 21:14:55 +0000
commit3087dd678088754dddc0c801008e22ca2b7b9a37 (patch)
tree020aaee565bf4d104eefcde4a75536e0181e7683 /io.c
parent1201426dd43f5b4e12dfe520e2a9c5027d33dc11 (diff)
downloadstrace-3087dd678088754dddc0c801008e22ca2b7b9a37.tar.gz
strace-3087dd678088754dddc0c801008e22ca2b7b9a37.tar.bz2
strace-3087dd678088754dddc0c801008e22ca2b7b9a37.tar.xz
Linux: implement decoding of preadv and pwritev syscalls
* io.c [LINUX && HAVE_SYS_UIO_H] (sys_preadv, sys_pwritev): New functions. * linux/syscall.h (sys_preadv, sys_pwritev): Declare them. * linux/*/syscallent.h: Use them. Signed-off-by: Damir Shayhutdinov <damir@altlinux.ru> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Diffstat (limited to 'io.c')
-rw-r--r--io.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/io.c b/io.c
index 7ebf0ed..d94fb26 100644
--- a/io.c
+++ b/io.c
@@ -304,6 +304,39 @@ sys_pwrite(struct tcb *tcp)
return 0;
}
+#if HAVE_SYS_UIO_H
+int
+sys_preadv(struct tcb *tcp)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprintf(", ");
+ } else {
+ if (syserror(tcp)) {
+ tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
+ return 0;
+ }
+ tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1]);
+ tprintf(", %lu, ", tcp->u_arg[2]);
+ printllval(tcp, "%llu", PREAD_OFFSET_ARG);
+ }
+ return 0;
+}
+
+int
+sys_pwritev(struct tcb *tcp)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprintf(", ");
+ tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1]);
+ tprintf(", %lu, ", tcp->u_arg[2]);
+ printllval(tcp, "%llu", PREAD_OFFSET_ARG);
+ }
+ return 0;
+}
+#endif /* HAVE_SYS_UIO_H */
+
int
sys_sendfile(struct tcb *tcp)
{