From a3aa4423e70fa4cedd15eb2cd1aba525128987f4 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Tue, 14 Feb 2023 18:15:45 +0100 Subject: [PATCH] Document init function and add psInit to getrandom --- src/lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 1cf099f..83a4172 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,9 +1,6 @@ #![no_std] -/// Call this somewhere to force Rust to link this module. -/// The call doesn't need to execute, just exist. -/// -/// See +/// Reference this function somewhere (eg. ´use linker_fix_3sd::init´ in the main crate) to import all missing implementations. pub fn init() {} extern "C" { @@ -54,6 +51,7 @@ pub unsafe extern "C" fn getrandom( }; buflen = buflen.min(maxlen); + ctru_sys::psInit(); let ret = ctru_sys::PS_GenerateRandomBytes(buf, buflen); // avoid conflicting a real POSIX errno by using a value < 0