Implement sys/times.h on linux
This commit is contained in:
@@ -392,6 +392,10 @@ pub fn socketpair(domain: c_int, kind: c_int, protocol: c_int, socket_vector: *m
|
||||
e(unsafe { syscall!(SOCKETPAIR, domain, kind, protocol, socket_vector) }) as c_int
|
||||
}
|
||||
|
||||
pub fn times(out: *mut tms) -> clock_t {
|
||||
unsafe { syscall!(TIMES, out) as clock_t }
|
||||
}
|
||||
|
||||
pub fn uname(utsname: *mut utsname) -> c_int {
|
||||
e(unsafe { syscall!(UNAME, utsname, 0) }) as c_int
|
||||
}
|
||||
|
||||
@@ -821,6 +821,15 @@ pub fn socketpair(domain: c_int, kind: c_int, protocol: c_int, socket_vector: *m
|
||||
-1
|
||||
}
|
||||
|
||||
pub fn times(out: *mut tms) -> clock_t {
|
||||
let _ = write!(
|
||||
::FileWriter(2),
|
||||
"unimplemented: times({:p})",
|
||||
out
|
||||
);
|
||||
!0
|
||||
}
|
||||
|
||||
pub fn unlink(path: *const c_char) -> c_int {
|
||||
let path = unsafe { c_str(path) };
|
||||
e(syscall::unlink(path)) as c_int
|
||||
|
||||
@@ -223,3 +223,11 @@ pub struct rusage {
|
||||
pub ru_nvcsw: c_long,
|
||||
pub ru_nivcsw: c_long
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct tms {
|
||||
tms_utime: clock_t,
|
||||
tms_stime: clock_t,
|
||||
tms_cutime: clock_t,
|
||||
tms_cstime: clock_t
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user