aboutsummaryrefslogtreecommitdiff
path: root/src/signal/getitimer.c
blob: aadf2ddcd3661196a0763ecb8d794d46d6884226 (plain) (blame)
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
#include <sys/time.h>
#include "syscall.h"

int getitimer(int which, struct itimerval *old)
{
	if (sizeof(time_t) > sizeof(long)) {
		long old32[4];
		int r = __syscall(SYS_getitimer, which, old32);
		if (!r) {
			old->it_interval.tv_sec = old32[0];
			old->it_interval.tv_usec = old32[1];
			old->it_value.tv_sec = old32[2];
			old->it_value.tv_usec = old32[3];
		}
		return __syscall_ret(r);
	}
	return syscall(SYS_getitimer, which, old);
}


#ifdef TEST
int
main(void) {
	return 0;
}
#endif