From 7fee138a341f73b81b9c4f8c59e3527c6a169ea3 Mon Sep 17 00:00:00 2001 From: FlorianNAdam <64063379+FlorianNAdam@users.noreply.github.com> Date: Thu, 9 Oct 2025 23:00:37 +0200 Subject: [PATCH] fix set_phys ioctl --- src/sys.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/sys.rs b/src/sys.rs index c3fa7e65..00abd6b0 100644 --- a/src/sys.rs +++ b/src/sys.rs @@ -7,7 +7,7 @@ use crate::compat::{ }; use nix::{ convert_ioctl_res, ioctl_none, ioctl_read, ioctl_read_buf, ioctl_readwrite, ioctl_write_int, - ioctl_write_ptr, request_code_read, + ioctl_write_ptr, ioctl_write_ptr_bad, request_code_read, request_code_write, }; #[repr(C)] @@ -88,7 +88,17 @@ ioctl_write_int!(ui_set_mscbit, UINPUT_IOCTL_BASE, 104); ioctl_write_int!(ui_set_ledbit, UINPUT_IOCTL_BASE, 105); ioctl_write_int!(ui_set_sndbit, UINPUT_IOCTL_BASE, 106); ioctl_write_int!(ui_set_ffbit, UINPUT_IOCTL_BASE, 107); -ioctl_write_ptr!(ui_set_phys, UINPUT_IOCTL_BASE, 108, libc::c_char); + +ioctl_write_ptr_bad!( + ui_set_phys, + request_code_write!( + UINPUT_IOCTL_BASE, + 108, + ::std::mem::size_of::<*const libc::c_char>() + ) as ::nix::sys::ioctl::ioctl_num_type, + libc::c_char +); + ioctl_write_int!(ui_set_swbit, UINPUT_IOCTL_BASE, 109); ioctl_write_int!(ui_set_propbit, UINPUT_IOCTL_BASE, 110);