From 6a1279f42fb952d61a997736b044caa115847ef5 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sun, 8 Oct 2023 15:00:49 +0200 Subject: [PATCH] sysdeps/managarm: add debug variable to log all ioctls --- sysdeps/managarm/generic/ioctl.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sysdeps/managarm/generic/ioctl.cpp b/sysdeps/managarm/generic/ioctl.cpp index 67b5281adb..90649d554d 100644 --- a/sysdeps/managarm/generic/ioctl.cpp +++ b/sysdeps/managarm/generic/ioctl.cpp @@ -17,14 +17,17 @@ namespace mlibc { +static constexpr bool logIoctls = false; + int ioctl_drm(int fd, unsigned long request, void *arg, int *result, HelHandle handle); int sys_ioctl(int fd, unsigned long request, void *arg, int *result) { -// mlibc::infoLogger() << "mlibc: ioctl with" -// << " type: 0x" << frg::hex_fmt(_IOC_TYPE(request)) -// << ", number: 0x" << frg::hex_fmt(_IOC_NR(request)) -// << " (raw request: " << frg::hex_fmt(request) << ")" -// << " on fd " << fd << frg::endlog; + if(logIoctls) + mlibc::infoLogger() << "mlibc: ioctl with" + << " type: 0x" << frg::hex_fmt(_IOC_TYPE(request)) + << ", number: 0x" << frg::hex_fmt(_IOC_NR(request)) + << " (raw request: " << frg::hex_fmt(request) << ")" + << " on fd " << fd << frg::endlog; SignalGuard sguard; auto handle = getHandleForFd(fd);