Skip to content

Commit

Permalink
Merge pull request #924 from ElectrodeYT/add-logging-variable-1
Browse files Browse the repository at this point in the history
managarm/sys_ioctl: add debug variable to log all ioctls
  • Loading branch information
qookei authored Oct 8, 2023
2 parents 0c33cfb + 6a1279f commit 0744d7a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions sysdeps/managarm/generic/ioctl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0744d7a

Please sign in to comment.