2011-02-17 18:11:09 +01:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
#include "namespace.h"
|
|
|
|
#include <lib.h>
|
|
|
|
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This is the implementation of the function to
|
|
|
|
* invoke the interval timer setting system call.
|
|
|
|
*/
|
2012-03-30 17:11:01 +02:00
|
|
|
int setitimer(int which, const struct itimerval *__restrict value,
|
|
|
|
struct itimerval *__restrict ovalue)
|
2011-02-17 18:11:09 +01:00
|
|
|
{
|
|
|
|
message m;
|
|
|
|
|
|
|
|
/* A null pointer for 'value' would make setitimer behave like getitimer,
|
|
|
|
* which is not according to the specification, so disallow null pointers.
|
|
|
|
*/
|
|
|
|
if (value == NULL) return(EINVAL);
|
|
|
|
|
|
|
|
m.m1_i1 = which;
|
2011-11-28 11:07:55 +01:00
|
|
|
m.m1_p1 = (char *) __UNCONST(value);
|
2011-02-17 18:11:09 +01:00
|
|
|
m.m1_p2 = (char *) ovalue;
|
|
|
|
|
|
|
|
return _syscall(PM_PROC_NR, ITIMER, &m);
|
|
|
|
}
|