Fix definition of errno to match what is used by musl

This commit is contained in:
Jeremy Soller
2019-07-03 19:47:55 -06:00
parent 208b56b487
commit 38099fe3d9
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ extern "C" {
#define ENOTSUP EOPNOTSUPP
extern __thread int errno;
#define errno (*__errno_location())
#ifdef __cplusplus
} // extern "C"
+3 -2
View File
@@ -3,14 +3,15 @@
use platform;
use platform::types::*;
//TODO: Consider removing, provided for compatibility with newlib
#[no_mangle]
pub unsafe extern "C" fn __errno() -> *mut c_int {
&mut platform::errno
__errno_location()
}
#[no_mangle]
pub unsafe extern "C" fn __errno_location() -> *mut c_int {
__errno()
&mut platform::errno
}
pub const EPERM: c_int = 1; /* Operation not permitted */