Pierre-Clément Tosi | 6a42fdc | 2022-12-08 13:51:05 +0000 | [diff] [blame] | 1 | // Copyright 2022, The Android Open Source Project |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | //! Low-level compatibility layer between baremetal Rust and Bionic C functions. |
| 16 | |
Pierre-Clément Tosi | 23c84c9 | 2023-07-14 16:50:56 +0000 | [diff] [blame] | 17 | use crate::rand::fill_with_entropy; |
Pierre-Clément Tosi | 67108c3 | 2023-06-30 11:04:02 +0000 | [diff] [blame] | 18 | use crate::read_sysreg; |
Charisee | 656095b | 2024-04-06 02:49:21 +0000 | [diff] [blame] | 19 | use core::ffi::c_char; |
| 20 | use core::ffi::c_int; |
| 21 | use core::ffi::c_void; |
| 22 | use core::ffi::CStr; |
| 23 | use core::ptr::addr_of_mut; |
| 24 | use core::slice; |
| 25 | use core::str; |
Pierre-Clément Tosi | 6a42fdc | 2022-12-08 13:51:05 +0000 | [diff] [blame] | 26 | |
Pierre-Clément Tosi | 0393992 | 2024-06-06 12:44:49 +0100 | [diff] [blame] | 27 | use log::error; |
| 28 | use log::info; |
Pierre-Clément Tosi | 1bf532b | 2023-11-13 11:06:20 +0000 | [diff] [blame] | 29 | |
Pierre-Clément Tosi | ba4af8a | 2022-12-20 17:32:37 +0000 | [diff] [blame] | 30 | const EOF: c_int = -1; |
Pierre-Clément Tosi | 23c84c9 | 2023-07-14 16:50:56 +0000 | [diff] [blame] | 31 | const EIO: c_int = 5; |
Pierre-Clément Tosi | ba4af8a | 2022-12-20 17:32:37 +0000 | [diff] [blame] | 32 | |
Pierre-Clément Tosi | 67108c3 | 2023-06-30 11:04:02 +0000 | [diff] [blame] | 33 | /// Bionic thread-local storage. |
| 34 | #[repr(C)] |
| 35 | pub struct Tls { |
| 36 | /// Unused. |
| 37 | _unused: [u8; 40], |
| 38 | /// Use by the compiler as stack canary value. |
| 39 | pub stack_guard: u64, |
| 40 | } |
| 41 | |
| 42 | /// Bionic TLS. |
| 43 | /// |
| 44 | /// Provides the TLS used by Bionic code. This is unique as vmbase only supports one thread. |
| 45 | /// |
| 46 | /// Note that the linker script re-exports __bionic_tls.stack_guard as __stack_chk_guard for |
| 47 | /// compatibility with non-Bionic LLVM. |
| 48 | #[link_section = ".data.stack_protector"] |
| 49 | #[export_name = "__bionic_tls"] |
| 50 | pub static mut TLS: Tls = Tls { _unused: [0; 40], stack_guard: 0 }; |
| 51 | |
| 52 | /// Gets a reference to the TLS from the dedicated system register. |
| 53 | pub fn __get_tls() -> &'static mut Tls { |
| 54 | let tpidr = read_sysreg!("tpidr_el0"); |
| 55 | // SAFETY: The register is currently only written to once, from entry.S, with a valid value. |
| 56 | unsafe { &mut *(tpidr as *mut Tls) } |
| 57 | } |
| 58 | |
Pierre-Clément Tosi | 6a42fdc | 2022-12-08 13:51:05 +0000 | [diff] [blame] | 59 | #[no_mangle] |
| 60 | extern "C" fn __stack_chk_fail() -> ! { |
| 61 | panic!("stack guard check failed"); |
| 62 | } |
Pierre-Clément Tosi | a32c37c | 2022-12-08 13:54:03 +0000 | [diff] [blame] | 63 | |
| 64 | /// Called from C to cause abnormal program termination. |
| 65 | #[no_mangle] |
| 66 | extern "C" fn abort() -> ! { |
| 67 | panic!("C code called abort()") |
| 68 | } |
| 69 | |
| 70 | /// Error number set and read by C functions. |
| 71 | pub static mut ERRNO: c_int = 0; |
| 72 | |
| 73 | #[no_mangle] |
Chris Wailes | 4cdd19f | 2024-12-04 11:13:57 -0800 | [diff] [blame] | 74 | #[allow(unused_unsafe)] |
Pierre-Clément Tosi | a32c37c | 2022-12-08 13:54:03 +0000 | [diff] [blame] | 75 | unsafe extern "C" fn __errno() -> *mut c_int { |
Andrew Walbran | c06e734 | 2023-07-05 14:00:51 +0000 | [diff] [blame] | 76 | // SAFETY: C functions which call this are only called from the main thread, not from exception |
| 77 | // handlers. |
Charisee | 656095b | 2024-04-06 02:49:21 +0000 | [diff] [blame] | 78 | unsafe { addr_of_mut!(ERRNO) as *mut _ } |
Pierre-Clément Tosi | a32c37c | 2022-12-08 13:54:03 +0000 | [diff] [blame] | 79 | } |
| 80 | |
Pierre-Clément Tosi | ba4af8a | 2022-12-20 17:32:37 +0000 | [diff] [blame] | 81 | fn set_errno(value: c_int) { |
Andrew Walbran | c06e734 | 2023-07-05 14:00:51 +0000 | [diff] [blame] | 82 | // SAFETY: vmbase is currently single-threaded. |
Pierre-Clément Tosi | ba4af8a | 2022-12-20 17:32:37 +0000 | [diff] [blame] | 83 | unsafe { ERRNO = value }; |
| 84 | } |
| 85 | |
Pierre-Clément Tosi | 2c9d937 | 2023-07-14 16:49:01 +0000 | [diff] [blame] | 86 | fn get_errno() -> c_int { |
| 87 | // SAFETY: vmbase is currently single-threaded. |
| 88 | unsafe { ERRNO } |
| 89 | } |
| 90 | |
Pierre-Clément Tosi | 23c84c9 | 2023-07-14 16:50:56 +0000 | [diff] [blame] | 91 | #[no_mangle] |
| 92 | extern "C" fn getentropy(buffer: *mut c_void, length: usize) -> c_int { |
| 93 | if length > 256 { |
| 94 | // The maximum permitted value for the length argument is 256. |
| 95 | set_errno(EIO); |
| 96 | return -1; |
| 97 | } |
| 98 | |
| 99 | // SAFETY: Just like libc, we need to assume that `ptr` is valid. |
| 100 | let buffer = unsafe { slice::from_raw_parts_mut(buffer.cast::<u8>(), length) }; |
| 101 | fill_with_entropy(buffer).unwrap(); |
| 102 | |
| 103 | 0 |
| 104 | } |
| 105 | |
Pierre-Clément Tosi | a32c37c | 2022-12-08 13:54:03 +0000 | [diff] [blame] | 106 | /// Reports a fatal error detected by Bionic. |
| 107 | /// |
| 108 | /// # Safety |
| 109 | /// |
Andrew Walbran | c06e734 | 2023-07-05 14:00:51 +0000 | [diff] [blame] | 110 | /// Input strings `prefix` and `format` must be valid and properly NUL-terminated. |
Pierre-Clément Tosi | a32c37c | 2022-12-08 13:54:03 +0000 | [diff] [blame] | 111 | /// |
| 112 | /// # Note |
| 113 | /// |
Pierre-Clément Tosi | 05b0818 | 2024-07-04 17:54:52 +0100 | [diff] [blame] | 114 | /// This Rust function is missing the last argument of its C/C++ counterpart, a va_list. |
Pierre-Clément Tosi | a32c37c | 2022-12-08 13:54:03 +0000 | [diff] [blame] | 115 | #[no_mangle] |
| 116 | unsafe extern "C" fn async_safe_fatal_va_list(prefix: *const c_char, format: *const c_char) { |
Andrew Walbran | c06e734 | 2023-07-05 14:00:51 +0000 | [diff] [blame] | 117 | // SAFETY: The caller guaranteed that both strings were valid and NUL-terminated. |
| 118 | let (prefix, format) = unsafe { (CStr::from_ptr(prefix), CStr::from_ptr(format)) }; |
Pierre-Clément Tosi | a32c37c | 2022-12-08 13:54:03 +0000 | [diff] [blame] | 119 | |
| 120 | if let (Ok(prefix), Ok(format)) = (prefix.to_str(), format.to_str()) { |
| 121 | // We don't bother with printf formatting. |
Pierre-Clément Tosi | 0bd9808 | 2024-06-06 12:44:49 +0100 | [diff] [blame] | 122 | error!("FATAL BIONIC ERROR: {prefix}: \"{format}\" (unformatted)"); |
Pierre-Clément Tosi | a32c37c | 2022-12-08 13:54:03 +0000 | [diff] [blame] | 123 | } |
| 124 | } |
Pierre-Clément Tosi | ba4af8a | 2022-12-20 17:32:37 +0000 | [diff] [blame] | 125 | |
Pierre-Clément Tosi | f2a6e44 | 2024-06-28 10:33:52 +0100 | [diff] [blame] | 126 | #[cfg(target_arch = "aarch64")] |
| 127 | #[allow(clippy::enum_clike_unportable_variant)] // No risk if AArch64 only. |
Pierre-Clément Tosi | ba4af8a | 2022-12-20 17:32:37 +0000 | [diff] [blame] | 128 | #[repr(usize)] |
Pierre-Clément Tosi | c84449c | 2024-06-28 14:29:49 +0100 | [diff] [blame] | 129 | /// Fake FILE* values used by C to refer to the default streams. |
Pierre-Clément Tosi | f2a6e44 | 2024-06-28 10:33:52 +0100 | [diff] [blame] | 130 | /// |
| 131 | /// These values are intentionally invalid pointers so that dereferencing them will be caught. |
Pierre-Clément Tosi | c84449c | 2024-06-28 14:29:49 +0100 | [diff] [blame] | 132 | enum CFilePtr { |
Pierre-Clément Tosi | f2a6e44 | 2024-06-28 10:33:52 +0100 | [diff] [blame] | 133 | // On AArch64 with TCR_EL1.EPD1 set or TCR_EL1.T1SZ > 12, these VAs can't be mapped. |
| 134 | Stdout = 0xfff0_badf_badf_bad0, |
| 135 | Stderr = 0xfff0_badf_badf_bad1, |
Pierre-Clément Tosi | ba4af8a | 2022-12-20 17:32:37 +0000 | [diff] [blame] | 136 | } |
| 137 | |
Pierre-Clément Tosi | c84449c | 2024-06-28 14:29:49 +0100 | [diff] [blame] | 138 | impl CFilePtr { |
Pierre-Clément Tosi | 0393992 | 2024-06-06 12:44:49 +0100 | [diff] [blame] | 139 | fn write_lines(&self, s: &str) { |
| 140 | for line in s.split_inclusive('\n') { |
| 141 | let (line, ellipsis) = if let Some(stripped) = line.strip_suffix('\n') { |
| 142 | (stripped, "") |
| 143 | } else { |
| 144 | (line, " ...") |
| 145 | }; |
| 146 | |
| 147 | match self { |
| 148 | Self::Stdout => info!("{line}{ellipsis}"), |
| 149 | Self::Stderr => error!("{line}{ellipsis}"), |
| 150 | } |
| 151 | } |
| 152 | } |
| 153 | } |
| 154 | |
Pierre-Clément Tosi | c84449c | 2024-06-28 14:29:49 +0100 | [diff] [blame] | 155 | impl TryFrom<usize> for CFilePtr { |
Pierre-Clément Tosi | ba4af8a | 2022-12-20 17:32:37 +0000 | [diff] [blame] | 156 | type Error = &'static str; |
| 157 | |
| 158 | fn try_from(value: usize) -> Result<Self, Self::Error> { |
| 159 | match value { |
Pierre-Clément Tosi | c84449c | 2024-06-28 14:29:49 +0100 | [diff] [blame] | 160 | x if x == Self::Stdout as _ => Ok(Self::Stdout), |
| 161 | x if x == Self::Stderr as _ => Ok(Self::Stderr), |
Pierre-Clément Tosi | ba4af8a | 2022-12-20 17:32:37 +0000 | [diff] [blame] | 162 | _ => Err("Received Invalid FILE* from C"), |
| 163 | } |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | #[no_mangle] |
Pierre-Clément Tosi | c84449c | 2024-06-28 14:29:49 +0100 | [diff] [blame] | 168 | static stdout: CFilePtr = CFilePtr::Stdout; |
Pierre-Clément Tosi | ba4af8a | 2022-12-20 17:32:37 +0000 | [diff] [blame] | 169 | #[no_mangle] |
Pierre-Clément Tosi | c84449c | 2024-06-28 14:29:49 +0100 | [diff] [blame] | 170 | static stderr: CFilePtr = CFilePtr::Stderr; |
Pierre-Clément Tosi | ba4af8a | 2022-12-20 17:32:37 +0000 | [diff] [blame] | 171 | |
| 172 | #[no_mangle] |
| 173 | extern "C" fn fputs(c_str: *const c_char, stream: usize) -> c_int { |
Andrew Walbran | c06e734 | 2023-07-05 14:00:51 +0000 | [diff] [blame] | 174 | // SAFETY: Just like libc, we need to assume that `s` is a valid NULL-terminated string. |
Pierre-Clément Tosi | ba4af8a | 2022-12-20 17:32:37 +0000 | [diff] [blame] | 175 | let c_str = unsafe { CStr::from_ptr(c_str) }; |
| 176 | |
Pierre-Clément Tosi | c84449c | 2024-06-28 14:29:49 +0100 | [diff] [blame] | 177 | if let (Ok(s), Ok(f)) = (c_str.to_str(), CFilePtr::try_from(stream)) { |
Pierre-Clément Tosi | 0393992 | 2024-06-06 12:44:49 +0100 | [diff] [blame] | 178 | f.write_lines(s); |
Pierre-Clément Tosi | ba4af8a | 2022-12-20 17:32:37 +0000 | [diff] [blame] | 179 | 0 |
| 180 | } else { |
| 181 | set_errno(EOF); |
| 182 | EOF |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | #[no_mangle] |
| 187 | extern "C" fn fwrite(ptr: *const c_void, size: usize, nmemb: usize, stream: usize) -> usize { |
| 188 | let length = size.saturating_mul(nmemb); |
| 189 | |
Andrew Walbran | c06e734 | 2023-07-05 14:00:51 +0000 | [diff] [blame] | 190 | // SAFETY: Just like libc, we need to assume that `ptr` is valid. |
Pierre-Clément Tosi | ba4af8a | 2022-12-20 17:32:37 +0000 | [diff] [blame] | 191 | let bytes = unsafe { slice::from_raw_parts(ptr as *const u8, length) }; |
| 192 | |
Pierre-Clément Tosi | c84449c | 2024-06-28 14:29:49 +0100 | [diff] [blame] | 193 | if let (Ok(s), Ok(f)) = (str::from_utf8(bytes), CFilePtr::try_from(stream)) { |
Pierre-Clément Tosi | 0393992 | 2024-06-06 12:44:49 +0100 | [diff] [blame] | 194 | f.write_lines(s); |
Pierre-Clément Tosi | ba4af8a | 2022-12-20 17:32:37 +0000 | [diff] [blame] | 195 | length |
| 196 | } else { |
| 197 | 0 |
| 198 | } |
| 199 | } |
Pierre-Clément Tosi | 90cd4f1 | 2023-02-17 11:19:56 +0000 | [diff] [blame] | 200 | |
| 201 | #[no_mangle] |
| 202 | extern "C" fn strerror(n: c_int) -> *mut c_char { |
Pierre-Clément Tosi | 2c9d937 | 2023-07-14 16:49:01 +0000 | [diff] [blame] | 203 | cstr_error(n).as_ptr().cast_mut().cast() |
| 204 | } |
| 205 | |
| 206 | #[no_mangle] |
| 207 | extern "C" fn perror(s: *const c_char) { |
| 208 | let prefix = if s.is_null() { |
| 209 | None |
| 210 | } else { |
| 211 | // SAFETY: Just like libc, we need to assume that `s` is a valid NULL-terminated string. |
| 212 | let c_str = unsafe { CStr::from_ptr(s) }; |
Pierre-Clément Tosi | a699751 | 2024-06-28 13:54:31 +0100 | [diff] [blame] | 213 | if c_str.is_empty() { |
Pierre-Clément Tosi | 2c9d937 | 2023-07-14 16:49:01 +0000 | [diff] [blame] | 214 | None |
| 215 | } else { |
| 216 | Some(c_str.to_str().unwrap()) |
| 217 | } |
Pierre-Clément Tosi | 90cd4f1 | 2023-02-17 11:19:56 +0000 | [diff] [blame] | 218 | }; |
| 219 | |
Pierre-Clément Tosi | 2c9d937 | 2023-07-14 16:49:01 +0000 | [diff] [blame] | 220 | let error = cstr_error(get_errno()).to_str().unwrap(); |
| 221 | |
| 222 | if let Some(prefix) = prefix { |
Pierre-Clément Tosi | 0bd9808 | 2024-06-06 12:44:49 +0100 | [diff] [blame] | 223 | error!("{prefix}: {error}"); |
Pierre-Clément Tosi | 2c9d937 | 2023-07-14 16:49:01 +0000 | [diff] [blame] | 224 | } else { |
Pierre-Clément Tosi | 0bd9808 | 2024-06-06 12:44:49 +0100 | [diff] [blame] | 225 | error!("{error}"); |
Pierre-Clément Tosi | 2c9d937 | 2023-07-14 16:49:01 +0000 | [diff] [blame] | 226 | } |
| 227 | } |
| 228 | |
| 229 | fn cstr_error(n: c_int) -> &'static CStr { |
| 230 | // Messages taken from errno(1). |
| 231 | match n { |
Alan Stokes | f46a17c | 2025-01-05 15:50:18 +0000 | [diff] [blame] | 232 | 0 => c"Success", |
| 233 | 1 => c"Operation not permitted", |
| 234 | 2 => c"No such file or directory", |
| 235 | 3 => c"No such process", |
| 236 | 4 => c"Interrupted system call", |
| 237 | 5 => c"Input/output error", |
| 238 | 6 => c"No such device or address", |
| 239 | 7 => c"Argument list too long", |
| 240 | 8 => c"Exec format error", |
| 241 | 9 => c"Bad file descriptor", |
| 242 | 10 => c"No child processes", |
| 243 | 11 => c"Resource temporarily unavailable", |
| 244 | 12 => c"Cannot allocate memory", |
| 245 | 13 => c"Permission denied", |
| 246 | 14 => c"Bad address", |
| 247 | 15 => c"Block device required", |
| 248 | 16 => c"Device or resource busy", |
| 249 | 17 => c"File exists", |
| 250 | 18 => c"Invalid cross-device link", |
| 251 | 19 => c"No such device", |
| 252 | 20 => c"Not a directory", |
| 253 | 21 => c"Is a directory", |
| 254 | 22 => c"Invalid argument", |
| 255 | 23 => c"Too many open files in system", |
| 256 | 24 => c"Too many open files", |
| 257 | 25 => c"Inappropriate ioctl for device", |
| 258 | 26 => c"Text file busy", |
| 259 | 27 => c"File too large", |
| 260 | 28 => c"No space left on device", |
| 261 | 29 => c"Illegal seek", |
| 262 | 30 => c"Read-only file system", |
| 263 | 31 => c"Too many links", |
| 264 | 32 => c"Broken pipe", |
| 265 | 33 => c"Numerical argument out of domain", |
| 266 | 34 => c"Numerical result out of range", |
| 267 | 35 => c"Resource deadlock avoided", |
| 268 | 36 => c"File name too long", |
| 269 | 37 => c"No locks available", |
| 270 | 38 => c"Function not implemented", |
| 271 | 39 => c"Directory not empty", |
| 272 | 40 => c"Too many levels of symbolic links", |
| 273 | 42 => c"No message of desired type", |
| 274 | 43 => c"Identifier removed", |
| 275 | 44 => c"Channel number out of range", |
| 276 | 45 => c"Level 2 not synchronized", |
| 277 | 46 => c"Level 3 halted", |
| 278 | 47 => c"Level 3 reset", |
| 279 | 48 => c"Link number out of range", |
| 280 | 49 => c"Protocol driver not attached", |
| 281 | 50 => c"No CSI structure available", |
| 282 | 51 => c"Level 2 halted", |
| 283 | 52 => c"Invalid exchange", |
| 284 | 53 => c"Invalid request descriptor", |
| 285 | 54 => c"Exchange full", |
| 286 | 55 => c"No anode", |
| 287 | 56 => c"Invalid request code", |
| 288 | 57 => c"Invalid slot", |
| 289 | 59 => c"Bad font file format", |
| 290 | 60 => c"Device not a stream", |
| 291 | 61 => c"No data available", |
| 292 | 62 => c"Timer expired", |
| 293 | 63 => c"Out of streams resources", |
| 294 | 64 => c"Machine is not on the network", |
| 295 | 65 => c"Package not installed", |
| 296 | 66 => c"Object is remote", |
| 297 | 67 => c"Link has been severed", |
| 298 | 68 => c"Advertise error", |
| 299 | 69 => c"Srmount error", |
| 300 | 70 => c"Communication error on send", |
| 301 | 71 => c"Protocol error", |
| 302 | 72 => c"Multihop attempted", |
| 303 | 73 => c"RFS specific error", |
| 304 | 74 => c"Bad message", |
| 305 | 75 => c"Value too large for defined data type", |
| 306 | 76 => c"Name not unique on network", |
| 307 | 77 => c"File descriptor in bad state", |
| 308 | 78 => c"Remote address changed", |
| 309 | 79 => c"Can not access a needed shared library", |
| 310 | 80 => c"Accessing a corrupted shared library", |
| 311 | 81 => c".lib section in a.out corrupted", |
| 312 | 82 => c"Attempting to link in too many shared libraries", |
| 313 | 83 => c"Cannot exec a shared library directly", |
| 314 | 84 => c"Invalid or incomplete multibyte or wide character", |
| 315 | 85 => c"Interrupted system call should be restarted", |
| 316 | 86 => c"Streams pipe error", |
| 317 | 87 => c"Too many users", |
| 318 | 88 => c"Socket operation on non-socket", |
| 319 | 89 => c"Destination address required", |
| 320 | 90 => c"Message too long", |
| 321 | 91 => c"Protocol wrong type for socket", |
| 322 | 92 => c"Protocol not available", |
| 323 | 93 => c"Protocol not supported", |
| 324 | 94 => c"Socket type not supported", |
| 325 | 95 => c"Operation not supported", |
| 326 | 96 => c"Protocol family not supported", |
| 327 | 97 => c"Address family not supported by protocol", |
| 328 | 98 => c"Address already in use", |
| 329 | 99 => c"Cannot assign requested address", |
| 330 | 100 => c"Network is down", |
| 331 | 101 => c"Network is unreachable", |
| 332 | 102 => c"Network dropped connection on reset", |
| 333 | 103 => c"Software caused connection abort", |
| 334 | 104 => c"Connection reset by peer", |
| 335 | 105 => c"No buffer space available", |
| 336 | 106 => c"Transport endpoint is already connected", |
| 337 | 107 => c"Transport endpoint is not connected", |
| 338 | 108 => c"Cannot send after transport endpoint shutdown", |
| 339 | 109 => c"Too many references: cannot splice", |
| 340 | 110 => c"Connection timed out", |
| 341 | 111 => c"Connection refused", |
| 342 | 112 => c"Host is down", |
| 343 | 113 => c"No route to host", |
| 344 | 114 => c"Operation already in progress", |
| 345 | 115 => c"Operation now in progress", |
| 346 | 116 => c"Stale file handle", |
| 347 | 117 => c"Structure needs cleaning", |
| 348 | 118 => c"Not a XENIX named type file", |
| 349 | 119 => c"No XENIX semaphores available", |
| 350 | 120 => c"Is a named type file", |
| 351 | 121 => c"Remote I/O error", |
| 352 | 122 => c"Disk quota exceeded", |
| 353 | 123 => c"No medium found", |
| 354 | 124 => c"Wrong medium type", |
| 355 | 125 => c"Operation canceled", |
| 356 | 126 => c"Required key not available", |
| 357 | 127 => c"Key has expired", |
| 358 | 128 => c"Key has been revoked", |
| 359 | 129 => c"Key was rejected by service", |
| 360 | 130 => c"Owner died", |
| 361 | 131 => c"State not recoverable", |
| 362 | 132 => c"Operation not possible due to RF-kill", |
| 363 | 133 => c"Memory page has hardware error", |
| 364 | _ => c"Unknown errno value", |
Pierre-Clément Tosi | 2c9d937 | 2023-07-14 16:49:01 +0000 | [diff] [blame] | 365 | } |
Pierre-Clément Tosi | 90cd4f1 | 2023-02-17 11:19:56 +0000 | [diff] [blame] | 366 | } |