use std::process::ExitCode;

use yggdrasil_rt::io::filesystem as fs;

fn run() -> Result<(), yggdrasil_rt::Error> {
    let mut buffer = [0; 0];
    fs::filesystem_control::<fs::FlushCache>(None, &mut buffer, &())
}

pub fn main() -> ExitCode {
    match run() {
        Ok(()) => ExitCode::SUCCESS,
        Err(error) => {
            eprintln!("Error: {error:?}");
            ExitCode::FAILURE
        }
    }
}
