Skip to content
Snippets Groups Projects
Commit 3db0588d authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Merge branch 'ctime_r' into 'master'

added ctime_r

See merge request redox-os/relibc!250
parents 631fd4f0 278a70c8
No related branches found
No related tags found
No related merge requests found
......@@ -138,11 +138,14 @@ pub unsafe extern "C" fn ctime(clock: *const time_t) -> *mut c_char {
asctime(localtime(clock))
}
// #[no_mangle]
pub extern "C" fn ctime_r(clock: *const time_t, buf: *mut c_char) -> *mut c_char {
unimplemented!();
#[no_mangle]
pub unsafe extern "C" fn ctime_r(clock: *const time_t, buf: *mut c_char) -> *mut c_char {
let mut tm1 : tm = core::mem::uninitialized();
localtime_r(clock, &mut tm1);
asctime_r(&mut tm1, buf)
}
#[no_mangle]
pub extern "C" fn difftime(time1: time_t, time0: time_t) -> c_double {
(time1 - time0) as c_double
......
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