aboutsummaryrefslogtreecommitdiff
path: root/bsd-user/strace.c
diff options
context:
space:
mode:
authorSean Bruno <sbruno@freebsd.org>2014-06-08 09:57:25 -0700
committerPeter Maydell <peter.maydell@linaro.org>2014-06-11 00:25:06 +0100
commitb85159a3a325b1b3257482d52ce52225944dbcdd (patch)
treefc8d39350552d9206fb2ef8941b500b59d2fec69 /bsd-user/strace.c
parent80b346040d23c7e409949bef578ef4ef2c679e49 (diff)
bsd-user: Implement strace support for print_ioctl syscall
Signed-off-by: Sean Bruno <sbruno@freebsd.org> Message-id: 1402246651-71099-5-git-send-email-sbruno@freebsd.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'bsd-user/strace.c')
-rw-r--r--bsd-user/strace.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/bsd-user/strace.c b/bsd-user/strace.c
index b2633d0cb4..e33dd4d48f 100644
--- a/bsd-user/strace.c
+++ b/bsd-user/strace.c
@@ -89,6 +89,25 @@ static void print_execve(const struct syscallname *name, abi_long arg1,
gemu_log("NULL})");
}
+static void print_ioctl(const struct syscallname *name,
+ abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4,
+ abi_long arg5, abi_long arg6)
+{
+ /* Decode the ioctl request */
+ gemu_log("%s(%d, 0x%0lx { IO%s%s GRP:0x%x('%c') CMD:%d LEN:%d }, 0x"
+ TARGET_ABI_FMT_lx ", ...)",
+ name->name,
+ (int)arg1,
+ (unsigned long)arg2,
+ arg2 & IOC_OUT ? "R" : "",
+ arg2 & IOC_IN ? "W" : "",
+ (unsigned)IOCGROUP(arg2),
+ isprint(IOCGROUP(arg2)) ? (char)IOCGROUP(arg2) : '?',
+ (int)arg2 & 0xFF,
+ (int)IOCPARM_LEN(arg2),
+ arg3);
+}
+
/*
* Variants for the return value output function
*/