|
@@ -143,8 +143,9 @@ pub unsafe extern "C" fn strcmp(s1: *const c_char, s2: *const c_char) -> c_int {
|
|
|
}
|
|
|
|
|
|
// #[no_mangle]
|
|
|
-pub extern "C" fn strcoll(s1: *const c_char, s2: *const c_char) -> c_int {
|
|
|
- unimplemented!();
|
|
|
+pub unsafe extern "C" fn strcoll(s1: *const c_char, s2: *const c_char) -> c_int {
|
|
|
+ // relibc has no locale stuff (yet)
|
|
|
+ strcmp(s1, s2)
|
|
|
}
|
|
|
|
|
|
#[no_mangle]
|
|
@@ -400,7 +401,12 @@ pub extern "C" fn strtok_r(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// #[no_mangle]
|
|
|
-pub extern "C" fn strxfrm(s1: *mut c_char, s2: *const c_char, n: usize) -> size_t {
|
|
|
- unimplemented!();
|
|
|
+#[no_mangle]
|
|
|
+pub unsafe extern "C" fn strxfrm(s1: *mut c_char, s2: *const c_char, n: usize) -> size_t {
|
|
|
+ // relibc has no locale stuff (yet)
|
|
|
+ let len = strlen(s2);
|
|
|
+ if len < n {
|
|
|
+ strcpy(s1, s2);
|
|
|
+ }
|
|
|
+ len
|
|
|
}
|