* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* Copyright (c) 2003-2006 Roland McGrath <roland@redhat.com>
* Copyright (c) 2006-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * Copyright (c) 2015-2017 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
const struct sembuf *sb = elem_buf;
tprintf("{%u, %d, ", sb->sem_num, sb->sem_op);
- printflags(semop_flags, sb->sem_flg, "SEM_???");
+ printflags(semop_flags, (unsigned short) sb->sem_flg, "SEM_???");
tprints("}");
return true;
#endif
static void
-tprint_sembuf_array(struct tcb *tcp, const long addr, const unsigned long count)
+tprint_sembuf_array(struct tcb *const tcp, const kernel_ulong_t addr,
+ const unsigned int count)
{
#if defined HAVE_SYS_SEM_H || defined HAVE_LINUX_SEM_H
struct sembuf sb;
print_array(tcp, addr, count, &sb, sizeof(sb),
- umoven_or_printaddr, print_sembuf, 0);
+ tfetch_mem, print_sembuf, 0);
#else
printaddr(addr);
#endif
- tprintf(", %lu", count);
+ tprintf(", %u", count);
}
SYS_FUNC(semop)
{
- tprintf("%lu, ", tcp->u_arg[0]);
+ tprintf("%d, ", (int) tcp->u_arg[0]);
if (indirect_ipccall(tcp)) {
tprint_sembuf_array(tcp, tcp->u_arg[3], tcp->u_arg[1]);
} else {
SYS_FUNC(semtimedop)
{
- tprintf("%lu, ", tcp->u_arg[0]);
+ tprintf("%d, ", (int) tcp->u_arg[0]);
if (indirect_ipccall(tcp)) {
tprint_sembuf_array(tcp, tcp->u_arg[3], tcp->u_arg[1]);
tprints(", ");
SYS_FUNC(semget)
{
- if (tcp->u_arg[0])
- tprintf("%#lx", tcp->u_arg[0]);
- else
- tprints("IPC_PRIVATE");
- tprintf(", %lu, ", tcp->u_arg[1]);
+ printxval(ipc_private, (unsigned int) tcp->u_arg[0], NULL);
+ tprintf(", %d, ", (int) tcp->u_arg[1]);
if (printflags(resource_flags, tcp->u_arg[2] & ~0777, NULL) != 0)
tprints("|");
- tprintf("%#lo", tcp->u_arg[2] & 0777);
+ print_numeric_umode_t(tcp->u_arg[2] & 0777);
return RVAL_DECODED;
}
SYS_FUNC(semctl)
{
- tprintf("%lu, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
+ tprintf("%d, %d, ", (int) tcp->u_arg[0], (int) tcp->u_arg[1]);
PRINTCTL(semctl_flags, tcp->u_arg[2], "SEM_???");
tprints(", ");
- if (indirect_ipccall(tcp)) {
+ if (indirect_ipccall(tcp)
+#ifdef SPARC64
+ && current_personality != 0
+#endif
+ ) {
printnum_ptr(tcp, tcp->u_arg[3]);
} else {
- tprintf("%#lx", tcp->u_arg[3]);
+ printaddr(tcp->u_arg[3]);
}
return RVAL_DECODED;
}