boot_options_rs/boot_options.rs
1// Copyright 2026 The Fuchsia Authors
2//
3// Use of this source code is governed by a MIT-style
4// license that can be found in the LICENSE file or at
5// https://opensource.org/licenses/MIT
6
7#![no_std]
8
9unsafe extern "C" {
10 fn cpp_boot_options_enable_debugging_syscalls() -> bool;
11}
12
13/// Returns whether debugging syscalls are enabled in kernel boot options.
14// TODO(https://fxbug.dev/537008680): Replace per-flag FFI query with direct BootOptions struct
15// layout binding.
16pub fn enable_debugging_syscalls() -> bool {
17 // SAFETY: FFI query function reads global boot/feature option and has no side effects.
18 unsafe { cpp_boot_options_enable_debugging_syscalls() }
19}