process.c: move getcpu parser to a separate file
* getcpu.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* process.c (sys_getcpu): Move to getcpu.c.
diff --git a/getcpu.c b/getcpu.c
new file mode 100644
index 0000000..522786f
--- /dev/null
+++ b/getcpu.c
@@ -0,0 +1,23 @@
+#include "defs.h"
+
+int
+sys_getcpu(struct tcb *tcp)
+{
+ if (exiting(tcp)) {
+ unsigned u;
+ if (tcp->u_arg[0] == 0)
+ tprints("NULL, ");
+ else if (umove(tcp, tcp->u_arg[0], &u) < 0)
+ tprintf("%#lx, ", tcp->u_arg[0]);
+ else
+ tprintf("[%u], ", u);
+ if (tcp->u_arg[1] == 0)
+ tprints("NULL, ");
+ else if (umove(tcp, tcp->u_arg[1], &u) < 0)
+ tprintf("%#lx, ", tcp->u_arg[1]);
+ else
+ tprintf("[%u], ", u);
+ tprintf("%#lx", tcp->u_arg[2]);
+ }
+ return 0;
+}