qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Sean Bruno <sbruno@freebsd.org>
To: qemu-devel@nongnu.org
Cc: Sean Bruno <sbruno@freebsd.org>
Subject: [Qemu-devel] [PATCH 4/9 v3] FreeBSD-user: Implement print_ioctl() syscall
Date: Fri,  6 Jun 2014 06:49:34 -0700	[thread overview]
Message-ID: <1402062579-28716-5-git-send-email-sbruno@freebsd.org> (raw)
In-Reply-To: <1402062579-28716-1-git-send-email-sbruno@freebsd.org>

Signed-off-by: Sean Bruno <sbruno@freebsd.org>
---
 bsd-user/freebsd/strace.list |  2 +-
 bsd-user/strace.c            | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/bsd-user/freebsd/strace.list b/bsd-user/freebsd/strace.list
index 3235f16..718357b 100644
--- a/bsd-user/freebsd/strace.list
+++ b/bsd-user/freebsd/strace.list
@@ -80,7 +80,7 @@
 { TARGET_FREEBSD_NR_getsockopt, "getsockopt", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_gettimeofday, "gettimeofday", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_getuid, "getuid", "%s()", NULL, NULL },
-{ TARGET_FREEBSD_NR_ioctl, "ioctl", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_ioctl, "ioctl", NULL, print_ioctl, NULL },
 { TARGET_FREEBSD_NR_issetugid, "issetugid", "%s()", NULL, NULL },
 { TARGET_FREEBSD_NR_kevent, "kevent", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_kill, "kill", NULL, NULL, NULL },
diff --git a/bsd-user/strace.c b/bsd-user/strace.c
index b2633d0..e33dd4d 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
  */
-- 
1.9.3

  parent reply	other threads:[~2014-06-06 13:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-06 13:49 [Qemu-devel] [PATCH 0/9 v3] FreeBSD-user: breakout the BSDs Sean Bruno
2014-06-06 13:49 ` [Qemu-devel] [PATCH 1/9 v3] FreeBSD-user: add HOST_VARIANT_DIR for various *BSD dependent code Sean Bruno
2014-06-07 22:00   ` Peter Maydell
2014-06-06 13:49 ` [Qemu-devel] [PATCH 2/9 v3] FreeBSD-user: GPL v2 update and sylte/whitespace Sean Bruno
2014-06-07 22:03   ` Peter Maydell
2014-06-06 13:49 ` [Qemu-devel] [PATCH 3/9 v3] FreeBSD-user: Implement print_sysctl() syscall Sean Bruno
2014-06-07 21:58   ` Peter Maydell
2014-06-06 13:49 ` Sean Bruno [this message]
2014-06-07 22:01   ` [Qemu-devel] [PATCH 4/9 v3] FreeBSD-user: Implement print_ioctl() syscall Peter Maydell
2014-06-06 13:49 ` [Qemu-devel] [PATCH 5/9 v3] FreeBSD-user: Implement print_sysarch() syscall Sean Bruno
2014-06-07 22:18   ` Peter Maydell
2014-06-06 13:49 ` [Qemu-devel] [PATCH 6/9 v3] FreeBSD-user: Add __acl_* to the table of syscalls Sean Bruno
2014-06-07 22:08   ` Peter Maydell
2014-06-07 22:36     ` Sean Bruno
2014-06-06 13:49 ` [Qemu-devel] [PATCH 7/9 v3] FreeBSD-user: Add extattr_* " Sean Bruno
2014-06-07 22:10   ` Peter Maydell
2014-06-08 16:55     ` Sean Bruno
2014-06-06 13:49 ` [Qemu-devel] [PATCH 8/9 v3] FreeBSD-user: Add thr_* " Sean Bruno
2014-06-07 22:19   ` Peter Maydell
2014-06-08 16:55     ` Sean Bruno
2014-06-06 13:49 ` [Qemu-devel] [PATCH 9/9 v3] FreeBSD-user: Add support for missing syscalls Sean Bruno
2014-06-07 22:12   ` Peter Maydell
2014-06-08 16:56     ` Sean Bruno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1402062579-28716-5-git-send-email-sbruno@freebsd.org \
    --to=sbruno@freebsd.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).