Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/libc/src/new/qurt/time.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / libc / src / new / qurt / time.rs` 45 lines ยท 1773 bytes Raw Blame History 1 //! Header: `time.h` 2 3 use super::*; 4 use crate::prelude::*; 5 6 // Clock types 7 pub const CLOCK_REALTIME: clockid_t = 0; 8 pub const CLOCK_MONOTONIC: clockid_t = 1; 9 pub const CLOCK_THREAD_CPUTIME_ID: clockid_t = 2; 10 pub const CLOCK_PROCESS_CPUTIME_ID: clockid_t = 3; 11 12 extern "C" { 13 pub fn time(tloc: *mut time_t) -> time_t; 14 pub fn clock() -> clock_t; 15 pub fn difftime(time1: time_t, time0: time_t) -> c_double; 16 pub fn mktime(tm: *mut tm) -> time_t; 17 pub fn gmtime(timep: *const time_t) -> *mut tm; 18 pub fn gmtime_r(timep: *const time_t, result: *mut tm) -> *mut tm; 19 pub fn localtime(timep: *const time_t) -> *mut tm; 20 pub fn localtime_r(timep: *const time_t, result: *mut tm) -> *mut tm; 21 pub fn asctime(tm: *const tm) -> *mut c_char; 22 pub fn asctime_r(tm: *const tm, buf: *mut c_char) -> *mut c_char; 23 pub fn ctime(timep: *const time_t) -> *mut c_char; 24 pub fn ctime_r(timep: *const time_t, buf: *mut c_char) -> *mut c_char; 25 pub fn strftime( 26 s: *mut c_char, 27 maxsize: size_t, 28 format: *const c_char, 29 timeptr: *const tm, 30 ) -> size_t; 31 pub fn strptime(s: *const c_char, format: *const c_char, tm: *mut tm) -> *mut c_char; 32 pub fn clock_gettime(clk_id: clockid_t, tp: *mut timespec) -> c_int; 33 pub fn nanosleep(req: *const timespec, rem: *mut timespec) -> c_int; 34 35 // POSIX timer functions (from QuRT time.h) 36 pub fn timer_create(clockid: clockid_t, evp: *mut sigevent, timerid: *mut timer_t) -> c_int; 37 pub fn timer_delete(timerid: timer_t) -> c_int; 38 pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> c_int; 39 pub fn timer_settime( 40 timerid: timer_t, 41 flags: c_int, 42 value: *const itimerspec, 43 ovalue: *mut itimerspec, 44 ) -> c_int; 45 }