summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorJohn Hughes <john@Calva.COM>2001-03-07 13:21:24 +0000
committerJohn Hughes <john@Calva.COM>2001-03-07 13:21:24 +0000
commit5a826b8427383232940249ca16f543178fbeeba4 (patch)
tree5482b16a30cc883530b5e6e9be07b2659e9175aa /io.c
parent7737c8ad9de625c4e1dce0f06389905d950a6ad7 (diff)
downloadstrace-5a826b8427383232940249ca16f543178fbeeba4.tar.gz
strace-5a826b8427383232940249ca16f543178fbeeba4.tar.bz2
strace-5a826b8427383232940249ca16f543178fbeeba4.tar.xz
Fix off_t args on FreeBSD
Diffstat (limited to 'io.c')
-rw-r--r--io.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/io.c b/io.c
index 0fe8c3d..6bb986c 100644
--- a/io.c
+++ b/io.c
@@ -130,7 +130,7 @@ struct tcb *tcp;
return 0;
}
-#if defined(SVR4) || defined(FREEBSD)
+#if defined(SVR4)
int
sys_pread(tcp)
@@ -147,14 +147,9 @@ struct tcb *tcp;
/* off_t is signed int */
tprintf(", %lu, %ld", tcp->u_arg[2], tcp->u_arg[3]);
#else
-#ifndef FREEBSD
tprintf(", %lu, %llu", tcp->u_arg[2],
(((unsigned long long) tcp->u_arg[4]) << 32
| tcp->u_arg[3]));
-#else
- tprintf(", %lu, %llu", tcp->u_arg[2],
- (((off_t) tcp->u_arg[3]) << 32) + tcp->u_arg[4]);
-#endif
#endif
}
return 0;
@@ -171,19 +166,14 @@ struct tcb *tcp;
/* off_t is signed int */
tprintf(", %lu, %ld", tcp->u_arg[2], tcp->u_arg[3]);
#else
-#ifndef FREEBSD
tprintf(", %lu, %llu", tcp->u_arg[2],
(((unsigned long long) tcp->u_arg[4]) << 32
| tcp->u_arg[3]));
-#else
- tprintf(", %lu, %llu", tcp->u_arg[2],
- (((off_t) tcp->u_arg[3]) << 32) + tcp->u_arg[4]);
-#endif
#endif
}
return 0;
}
-#endif /* SVR4 || FREEBSD */
+#endif /* SVR4 */
#ifdef FREEBSD
#include <sys/types.h>
@@ -279,7 +269,7 @@ struct tcb *tcp;
#endif /* LINUX */
-#if _LFS64_LARGEFILE
+#if _LFS64_LARGEFILE || FREEBSD
int
sys_pread64(tcp)
struct tcb *tcp;
@@ -287,11 +277,13 @@ struct tcb *tcp;
if (entering(tcp)) {
tprintf("%ld, ", tcp->u_arg[0]);
} else {
+ ALIGN64 (tcp, 3);
if (syserror(tcp))
tprintf("%#lx", tcp->u_arg[1]);
else
printstr(tcp, tcp->u_arg[1], tcp->u_rval);
- tprintf(", %lu, %#llx", tcp->u_arg[2], get64(tcp->u_arg[3], tcp->u_arg[4]));
+ tprintf(", %lu, %#llx", tcp->u_arg[2],
+ get64(tcp->u_arg[3], tcp->u_arg[4]));
}
return 0;
}
@@ -301,9 +293,11 @@ sys_pwrite64(tcp)
struct tcb *tcp;
{
if (entering(tcp)) {
+ ALIGN64 (tcp, 3);
tprintf("%ld, ", tcp->u_arg[0]);
printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
- tprintf(", %lu, %#llx", tcp->u_arg[2], get64(tcp->u_arg[3], tcp->u_arg[4]));
+ tprintf(", %lu, %#llx", tcp->u_arg[2],
+ get64(tcp->u_arg[3], tcp->u_arg[4]));
}
return 0;
}