* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdio.h>
-#include <errno.h>
+#include "qemu/osdep.h"
#include <sys/select.h>
-#include <sys/types.h>
-#include <unistd.h>
#include <sys/syscall.h>
#include <sys/ioccom.h>
-#include <ctype.h>
#include "qemu.h"
* Utility functions
*/
+static void print_sysctl(const struct syscallname *name, abi_long arg1,
+ abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5,
+ abi_long arg6)
+{
+ uint32_t i;
+ int32_t *namep;
+
+ gemu_log("%s({ ", name->name);
+ namep = lock_user(VERIFY_READ, arg1, sizeof(int32_t) * arg2, 1);
+ if (namep) {
+ int32_t *p = namep;
+
+ for (i = 0; i < (uint32_t)arg2; i++) {
+ gemu_log("%d ", tswap32(*p++));
+ }
+ unlock_user(namep, arg1, 0);
+ }
+ gemu_log("}, %u, 0x" TARGET_ABI_FMT_lx ", 0x" TARGET_ABI_FMT_lx ", 0x"
+ TARGET_ABI_FMT_lx ", 0x" TARGET_ABI_FMT_lx ")",
+ (uint32_t)arg2, arg3, arg4, arg5, arg6);
+}
+
static void print_execve(const struct syscallname *name, abi_long arg1,
abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5,
abi_long arg6)
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
*/