make vfs & filesystems use failable copying
[minix3.git] / lib / libsys / sys_vtimer.c
blob794a09398aa4f96cfc45ffe2823da96214c179d9
1 #include "syslib.h"
3 int sys_vtimer(proc, which, newval, oldval)
4 endpoint_t proc; /* proc to retrieve/set the timer for */
5 int which; /* timer to retrieve/set */
6 clock_t *newval; /* if non-NULL, set to this new value */
7 clock_t *oldval; /* if non-NULL, old value is stored here */
9 message m;
10 int r;
12 m.VT_ENDPT = proc;
13 m.VT_WHICH = which;
14 if (newval != NULL) {
15 m.VT_SET = 1;
16 m.VT_VALUE = *newval;
17 } else {
18 m.VT_SET = 0;
21 r = _kernel_call(SYS_VTIMER, &m);
23 if (oldval != NULL) {
24 *oldval = m.VT_VALUE;
27 return(r);