Path: blob/main/e2e_tests/guest_under_test/rootfs/readclock/src/main.rs
5394 views
// Copyright 2024 The ChromiumOS Authors1// Use of this source code is governed by a BSD-style license that can be2// found in the LICENSE file.34use anyhow::Result;56#[cfg(any(target_os = "linux", target_os = "android"))]7fn main() -> Result<()> {8use readclock::ClockValues;9let clocks = ClockValues::now();10println!("{}", serde_json::to_string(&clocks)?);11Ok(())12}1314// Fallback main function to make the library's serialize / deserialize implementation usable on the15// e2etest side (which may not be Linux environment).16// This workaround is needed due to cargo's dependency limitations.17// c.f. https://github.com/rust-lang/cargo/issues/198218#[cfg(not(any(target_os = "linux", target_os = "android")))]19fn main() -> Result<()> {20unimplemented!("This architecture does not support reading CLOCK_MONOTONIC and CLOCK_BOOTTIME")21}222324