From d6f52ed12acfb29de82c024506dca07fbbed46aa Mon Sep 17 00:00:00 2001 From: Fenrir Date: Wed, 14 Mar 2018 22:01:05 -0600 Subject: [PATCH] Add apt::set_app_cpu_time_limit --- ctru-rs/src/services/apt.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ctru-rs/src/services/apt.rs b/ctru-rs/src/services/apt.rs index 708ac28..53a0c6d 100644 --- a/ctru-rs/src/services/apt.rs +++ b/ctru-rs/src/services/apt.rs @@ -17,6 +17,17 @@ impl Apt { ::libctru::aptMainLoop() } } + + pub fn set_app_cpu_time_limit(&self, percent: u32) -> ::Result<()> { + unsafe { + let r = ::libctru::APT_SetAppCpuTimeLimit(percent); + if r < 0 { + Err(r.into()) + } else { + Ok(()) + } + } + } } impl Drop for Apt {