aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFenrir <[email protected]>2018-03-14 22:01:05 -0600
committerFenrirWolf <[email protected]>2018-03-17 00:20:47 -0600
commitd6f52ed12acfb29de82c024506dca07fbbed46aa (patch)
treef81fada7c1aab94a09aad8d82e98b67820f6f6d9
parentUpdate pinned nightly (diff)
downloadctru-rs-d6f52ed12acfb29de82c024506dca07fbbed46aa.tar.xz
ctru-rs-d6f52ed12acfb29de82c024506dca07fbbed46aa.zip
Add apt::set_app_cpu_time_limit
-rw-r--r--ctru-rs/src/services/apt.rs11
1 files changed, 11 insertions, 0 deletions
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 {