* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* Copyright (c) 2005-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * Copyright (c) 2014-2017 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#define D_NAME_LEN_MAX 256
static void
-print_old_dirent(struct tcb *tcp, long addr)
+print_old_dirent(struct tcb *const tcp, const kernel_ulong_t addr)
{
kernel_dirent d;
print_old_dirent(tcp, tcp->u_arg[1]);
/* Not much point in printing this out, it is always 1. */
if (tcp->u_arg[2] != 1)
- tprintf(", %lu", tcp->u_arg[2]);
+ tprintf(", %" PRI_klu, tcp->u_arg[2]);
}
return 0;
}
if (entering(tcp)) {
printfd(tcp, tcp->u_arg[0]);
- tprints(", ");
return 0;
}
const unsigned int count = tcp->u_arg[2];
if (syserror(tcp) || !verbose(tcp)) {
+ tprints(", ");
printaddr(tcp->u_arg[1]);
tprintf(", %u", count);
return 0;
if (len) {
buf = malloc(len);
if (!buf || umoven(tcp, tcp->u_arg[1], len, buf) < 0) {
+ tprints(", ");
printaddr(tcp->u_arg[1]);
tprintf(", %u", count);
free(buf);
buf = NULL;
}
+ tprints(",");
if (!abbrev(tcp))
- tprints("[");
+ tprints(" [");
for (i = 0; len && i <= len - sizeof(kernel_dirent); ) {
kernel_dirent *d = (kernel_dirent *) &buf[i];
zero_extend_signed_to_ull(d->d_off),
d->d_reclen);
- if (print_quoted_string(d->d_name, d_name_len,
- QUOTE_0_TERMINATED) > 0) {
- tprints("...");
- }
+ print_quoted_cstring(d->d_name, d_name_len);
tprints(", d_type=");
if (oob)
}
dents++;
if (d->d_reclen < sizeof(kernel_dirent)) {
- tprints("/* d_reclen < sizeof(struct dirent) */");
+ tprints_comment("d_reclen < sizeof(struct dirent)");
break;
}
i += d->d_reclen;
if (!abbrev(tcp))
tprints("]");
else
- tprintf("/* %u entries */", dents);
+ tprintf_comment("%u entries", dents);
tprintf(", %u", count);
free(buf);
return 0;