Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25525631 authored by Armelle Laine's avatar Armelle Laine
Browse files

libs: binder: trusty: binder_rpc_test to use CLOCK_BOOTTIME

all other clock types are not supported in Trusty

Bug: 369265611
Change-Id: Ia0a99fba01d8e1b6f73a140ec11711d1d6566a32
parent 51b2f8f1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ use binder::{BinderFeatures, IBinder, Status, StatusCode, Strong};
use binder_rpc_test_aidl::aidl::IBinderRpcSession::{BnBinderRpcSession, IBinderRpcSession};
use binder_rpc_test_aidl::aidl::IBinderRpcTest::{BnBinderRpcTest, IBinderRpcTest};
use binder_rpc_test_session::MyBinderRpcSession;
use libc::{clock_gettime, CLOCK_REALTIME};
use libc::{clock_gettime, CLOCK_BOOTTIME};
use rpcbinder::RpcSession;
use trusty_std::ffi::{CString, FallibleCString};

@@ -56,7 +56,7 @@ fn get_time_ns() -> u64 {
    let mut ts = libc::timespec { tv_sec: 0, tv_nsec: 0 };

    // Safety: Passing valid pointer to variable ts which lives past end of call
    assert_eq!(unsafe { clock_gettime(CLOCK_REALTIME, &mut ts) }, 0);
    assert_eq!(unsafe { clock_gettime(CLOCK_BOOTTIME, &mut ts) }, 0);

    ts.tv_sec as u64 * 1_000_000_000u64 + ts.tv_nsec as u64
}