sel4_newlib/errno.rs
1//
2// Copyright 2023, Colias Group, LLC
3//
4// SPDX-License-Identifier: BSD-2-Clause
5//
6
7use core::ffi::c_int;
8
9#[cfg(feature = "errno")]
10#[no_mangle]
11static mut errno: c_int = 0;
12
13#[cfg(not(feature = "errno"))]
14extern "C" {
15 static mut errno: c_int;
16}
17
18pub(crate) fn set_errno(err: c_int) {
19 unsafe {
20 errno = err;
21 }
22}
23
24#[allow(dead_code)]
25pub(crate) mod values {
26 use super::*;
27
28 pub(crate) const ENOENT: c_int = 2;
29 pub(crate) const ENOMEM: c_int = 12;
30}