Subject: Re: Setitimer ?
To: Riaz Randeree <RiazR@cat.co.za>
From: Bill Studenmund <wrstuden@nas.nasa.gov>
List: tech-kern
Date: 03/11/1999 10:58:03
On Thu, 11 Mar 1999, Riaz Randeree wrote:
> Hello,
>
> I have NetBSD 1.3.2 for i386, and the call to setitimer
> fails with EINVAL.
>
> Looking at file: sys/kern/kern_time.c,
> a function itimerfix is called and if tv_sec > 100 000 000
> (3/3/1973) it fails.
>
> So I set the time to the 0th hour and
> setitimer(ITIMER_REAL...) works.
>
> Does setitimer work with today's date?
> Could someone please provide me with a sample?
The problem here is that setitimer is trying to set a count-down timer,
not a time-of-day timer. So tv_sec is not the current time, but how many
seconds should elapse before the timer trips.
> All I want is similarly functionality as the POSIX
> timer_settime.
Unfortunatly I don't know what timer_settime does, so I can't help. :-(
There is at least a manpage on setitimer, which seems to explain what it
tries to do.
Take care,
Bill