* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999-2017 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
tprints(cmds[cmd].name);
return cmds[cmd].sub;
}
- tprintf("%u /* SUB_??? */", cmd);
+ tprintf("%u", cmd);
+ tprints_comment("SUB_???");
return SUB_NONE;
}
printfd(tcp, cb->aio_resfd);
}
if (cb->aio_flags & ~IOCB_FLAG_RESFD)
- tprintf(", flags=%x", cb->aio_flags);
+ tprintf(", flags=%#x", cb->aio_flags);
#endif
}
case SUB_COMMON:
if (cb->aio_lio_opcode == 1 && iocb_is_valid(cb)) {
tprints(", str=");
- printstr(tcp, cb->aio_buf, cb->aio_nbytes);
+ printstrn(tcp, cb->aio_buf, cb->aio_nbytes);
} else {
tprintf(", buf=%#" PRIx64, (uint64_t) cb->aio_buf);
}
static bool
print_iocbp(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
{
- kernel_ureg_t addr;
+ kernel_ulong_t addr;
struct iocb cb;
- if (elem_size < sizeof(kernel_ureg_t)) {
- addr = * (unsigned int *) elem_buf;
+ if (elem_size < sizeof(kernel_ulong_t)) {
+ addr = *(unsigned int *) elem_buf;
} else {
- addr = * (kernel_ureg_t *) elem_buf;
+ addr = *(kernel_ulong_t *) elem_buf;
}
tprints("{");
SYS_FUNC(io_submit)
{
- const long nr = widen_to_long(tcp->u_arg[1]);
- const kernel_ureg_t addr = tcp->u_arg[2];
- kernel_ureg_t iocbp;
+ const kernel_long_t nr =
+ truncate_klong_to_current_wordsize(tcp->u_arg[1]);
+ const kernel_ulong_t addr = tcp->u_arg[2];
+ kernel_ulong_t iocbp;
printaddr(tcp->u_arg[0]);
- tprintf(", %ld, ", nr);
+ tprintf(", %" PRI_kld ", ", nr);
if (nr < 0)
printaddr(addr);
{
if (entering(tcp)) {
printaddr(tcp->u_arg[0]);
- tprintf(", %ld, %ld, ",
- widen_to_long(tcp->u_arg[1]),
- widen_to_long(tcp->u_arg[2]));
+ tprintf(", %" PRI_kld ", %" PRI_kld ", ",
+ truncate_klong_to_current_wordsize(tcp->u_arg[1]),
+ truncate_klong_to_current_wordsize(tcp->u_arg[2]));
} else {
struct io_event buf;
print_array(tcp, tcp->u_arg[3], tcp->u_rval, &buf, sizeof(buf),