summaryrefslogtreecommitdiff
path: root/sysutils/strace/patches/patch-bb
blob: 8672eabb24caa2cdfd848ec34e2f07135f1a93dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
$NetBSD: patch-bb,v 1.1 2007/04/27 19:45:03 christos Exp $

--- io.c.orig	2005-06-01 15:22:08.000000000 -0400
+++ io.c	2007-04-27 15:37:52.000000000 -0400
@@ -74,6 +74,47 @@
 	return 0;
 }
 
+#ifdef NETBSD
+int
+sys_pread(tcp)
+struct tcb *tcp;
+{
+	if (entering(tcp)) {
+		tprintf("%ld, ", tcp->u_arg[0]);
+	} else {
+		if (syserror(tcp))
+			tprintf("%#lx", tcp->u_arg[1]);
+		else
+			printstr(tcp, tcp->u_arg[1], tcp->u_rval);
+		tprintf(", %lu", tcp->u_arg[2]);
+#ifdef _LP64
+		tprintf(", %lu", tcp->u_arg[3]);
+#else
+		tprintf(", %llu", ((unsigned long long)tcp->u_arg[4] << 32)
+			| tcp->u_arg[5]);
+#endif
+	}
+	return 0;
+}
+
+int
+sys_pwrite(tcp)
+struct tcb *tcp;
+{
+	if (entering(tcp)) {
+		tprintf("%ld, ", tcp->u_arg[0]);
+		printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+		tprintf(", %lu", tcp->u_arg[2]);
+#ifdef _LP64
+		tprintf(", %lu", tcp->u_arg[3]);
+#else
+		tprintf(", %llu", ((unsigned long long)tcp->u_arg[4] << 32)
+			| tcp->u_arg[5]);
+#endif
+	}
+	return 0;
+}
+#endif
 #if HAVE_SYS_UIO_H
 void
 tprint_iov(tcp, len, addr)