Skip to content
Snippets Groups Projects
Verified Commit 38099fe3 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Fix definition of errno to match what is used by musl

parent 208b56b4
No related branches found
No related tags found
No related merge requests found
Pipeline #5072 failed
...@@ -7,7 +7,7 @@ extern "C" { ...@@ -7,7 +7,7 @@ extern "C" {
#define ENOTSUP EOPNOTSUPP #define ENOTSUP EOPNOTSUPP
extern __thread int errno; #define errno (*__errno_location())
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
......
...@@ -3,14 +3,15 @@ ...@@ -3,14 +3,15 @@
use platform; use platform;
use platform::types::*; use platform::types::*;
//TODO: Consider removing, provided for compatibility with newlib
#[no_mangle] #[no_mangle]
pub unsafe extern "C" fn __errno() -> *mut c_int { pub unsafe extern "C" fn __errno() -> *mut c_int {
&mut platform::errno __errno_location()
} }
#[no_mangle] #[no_mangle]
pub unsafe extern "C" fn __errno_location() -> *mut c_int { pub unsafe extern "C" fn __errno_location() -> *mut c_int {
__errno() &mut platform::errno
} }
pub const EPERM: c_int = 1; /* Operation not permitted */ pub const EPERM: c_int = 1; /* Operation not permitted */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment