forked from ish-app/ish
-
Notifications
You must be signed in to change notification settings - Fork 11
/
time.h
61 lines (52 loc) · 1.52 KB
/
time.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef TIME_H
#define TIME_H
#include "misc.h"
dword_t sys_time(addr_t time_out);
dword_t sys_stime(addr_t time);
#define CLOCK_REALTIME_ 0
#define CLOCK_MONOTONIC_ 1
#define CLOCK_PROCESS_CPUTIME_ID_ 2
dword_t sys_clock_gettime(dword_t clock, addr_t tp);
dword_t sys_clock_settime(dword_t clock, addr_t tp);
dword_t sys_clock_getres(dword_t clock, addr_t res_addr);
struct timeval_ {
dword_t sec;
dword_t usec;
};
struct timespec_ {
dword_t sec;
dword_t nsec;
};
struct timezone_ {
dword_t minuteswest;
dword_t dsttime;
};
static inline clock_t_ clock_from_timeval(struct timeval_ timeval) {
return timeval.sec * 100 + timeval.usec / 10000;
}
#define ITIMER_REAL_ 0
#define ITIMER_VIRTUAL_ 1
#define ITIMER_PROF_ 2
struct itimerval_ {
struct timeval_ interval;
struct timeval_ value;
};
struct itimerspec_ {
struct timespec_ interval;
struct timespec_ value;
};
struct tms_ {
clock_t_ tms_utime; /* user time */
clock_t_ tms_stime; /* system time */
clock_t_ tms_cutime; /* user time of children */
clock_t_ tms_cstime; /* system time of children */
};
int_t sys_setitimer(int_t which, addr_t new_val, addr_t old_val);
uint_t sys_alarm(uint_t seconds);
dword_t sys_times(addr_t tbuf);
dword_t sys_nanosleep(addr_t req, addr_t rem);
dword_t sys_gettimeofday(addr_t tv, addr_t tz);
dword_t sys_settimeofday(addr_t tv, addr_t tz);
fd_t sys_timerfd_create(int_t clockid, int_t flags);
int_t sys_timerfd_settime(fd_t f, int_t flags, addr_t new_value_addr, addr_t old_value_addr);
#endif