pkgsrc/sysutils/strace/patches/patch-bb
2007-12-05 16:30:59 +00:00

61 lines
1.2 KiB
Text

$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;