Răsfoiți Sursa

Add aliases for compatibility

jD91mZM2 6 ani în urmă
părinte
comite
eaf7338946
2 a modificat fișierele cu 15 adăugiri și 0 ștergeri
  1. 10 0
      src/errno/src/lib.rs
  2. 5 0
      src/sys_stat/src/lib.rs

+ 10 - 0
src/errno/src/lib.rs

@@ -6,6 +6,16 @@ extern crate platform;
 
 use platform::types::*;
 
+#[no_mangle]
+pub unsafe extern "C" fn __errno() -> *mut c_int {
+    &mut platform::errno
+}
+
+#[no_mangle]
+pub unsafe extern "C" fn __errno_location() -> *mut c_int {
+    __errno()
+}
+
 pub const EPERM: c_int = 1; /* Operation not permitted */
 pub const ENOENT: c_int = 2; /* No such file or directory */
 pub const ESRCH: c_int = 3; /* No such process */

+ 5 - 0
src/sys_stat/src/lib.rs

@@ -64,6 +64,11 @@ pub extern "C" fn fstat(fildes: c_int, buf: *mut platform::types::stat) -> c_int
     platform::fstat(fildes, buf)
 }
 
+#[no_mangle]
+pub extern "C" fn __fxstat(_ver: c_int, fildes: c_int, buf: *mut platform::types::stat) -> c_int {
+    fstat(fildes, buf)
+}
+
 #[no_mangle]
 pub extern "C" fn lstat(path: *const c_char, buf: *mut platform::types::stat) -> c_int {
     platform::lstat(path, buf)