summaryrefslogtreecommitdiff
path: root/sysutils/strace/patches/patch-bb
blob: 21b2c3a326be07e4102a3c59723ffe560c40c712 (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
53
54
55
56
57
58
59
60
61
$NetBSD: patch-bb,v 1.2 2007/12/05 16:31:01 christos Exp $

--- io.c.orig	2006-12-13 14:57:23.000000000 -0500
+++ io.c	2007-12-05 11:17:44.000000000 -0500
@@ -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)
@@ -347,7 +388,7 @@
 
 #endif /* LINUX */
 
-#if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
+#if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T && !defined(NETBSD)
 int
 sys_pread64(tcp)
 struct tcb *tcp;