blob: 522786fd33614e94c5d71f2e9bd968a8f3ee8fbd [file] [log] [blame]
Dmitry V. Levin665f10c2014-12-11 19:21:54 +00001#include "defs.h"
2
3int
4sys_getcpu(struct tcb *tcp)
5{
6 if (exiting(tcp)) {
7 unsigned u;
8 if (tcp->u_arg[0] == 0)
9 tprints("NULL, ");
10 else if (umove(tcp, tcp->u_arg[0], &u) < 0)
11 tprintf("%#lx, ", tcp->u_arg[0]);
12 else
13 tprintf("[%u], ", u);
14 if (tcp->u_arg[1] == 0)
15 tprints("NULL, ");
16 else if (umove(tcp, tcp->u_arg[1], &u) < 0)
17 tprintf("%#lx, ", tcp->u_arg[1]);
18 else
19 tprintf("[%u], ", u);
20 tprintf("%#lx", tcp->u_arg[2]);
21 }
22 return 0;
23}