|  | @@ -93,6 +93,10 @@ fn syscall(call: Syscall<'_>) -> SysResult<i64> {
 | 
											
												
													
														|  |      #[cfg(test)]
 |  |      #[cfg(test)]
 | 
											
												
													
														|  |      return TEST_SYSCALL.with(|test_impl| unsafe { test_impl.borrow()(call) });
 |  |      return TEST_SYSCALL.with(|test_impl| unsafe { test_impl.borrow()(call) });
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +    // The type of integer taken by `ioctl` is different in glibc (i64) and
 | 
											
												
													
														|  | 
 |  | +    // musl (i32). musl builds would complain about useless conversion.
 | 
											
												
													
														|  | 
 |  | +    // `libc::ioctl` returns i32 on x86_64 while `libc::syscall` returns i64.
 | 
											
												
													
														|  | 
 |  | +    #[allow(clippy::useless_conversion)]
 | 
											
												
													
														|  |      #[cfg_attr(test, allow(unreachable_code))]
 |  |      #[cfg_attr(test, allow(unreachable_code))]
 | 
											
												
													
														|  |      {
 |  |      {
 | 
											
												
													
														|  |          let ret = unsafe {
 |  |          let ret = unsafe {
 | 
											
										
											
												
													
														|  | @@ -109,8 +113,6 @@ fn syscall(call: Syscall<'_>) -> SysResult<i64> {
 | 
											
												
													
														|  |                  } => libc::syscall(SYS_perf_event_open, &attr, pid, cpu, group, flags),
 |  |                  } => libc::syscall(SYS_perf_event_open, &attr, pid, cpu, group, flags),
 | 
											
												
													
														|  |                  Syscall::PerfEventIoctl { fd, request, arg } => {
 |  |                  Syscall::PerfEventIoctl { fd, request, arg } => {
 | 
											
												
													
														|  |                      let ret = libc::ioctl(fd.as_raw_fd(), request.try_into().unwrap(), arg);
 |  |                      let ret = libc::ioctl(fd.as_raw_fd(), request.try_into().unwrap(), arg);
 | 
											
												
													
														|  | -                    // `libc::ioctl` returns i32 on x86_64 while `libc::syscall` returns i64.
 |  | 
 | 
											
												
													
														|  | -                    #[allow(clippy::useless_conversion)]
 |  | 
 | 
											
												
													
														|  |                      ret.into()
 |  |                      ret.into()
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
												
													
														|  |              }
 |  |              }
 |