home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!corton!sophia!taloa!mimosa.unice.fr!tigli
- From: tigli@mimosa.unice.fr (Jean-Yves Tigli)
- Newsgroups: comp.unix.programmer
- Subject: Itimer
- Message-ID: <1992Aug17.081500.3915@taloa.unice.fr>
- Date: 17 Aug 92 08:15:00 GMT
- Sender: news@taloa.unice.fr (Usenet News)
- Organization: University of Nice-Sophia Antipolis
- Lines: 30
- Nntp-Posting-Host: mimosa.unice.fr
-
- I work on a Sparc station, and I use "sys/time.h" .
- Using "itimerval" type, I set timer value to generate
- an interruption according to :
-
- struct itimerval *value;
-
- value=(struct itimerval*)malloc(10);
-
- (value->it_interval).tv_sec=1;
- (value->it_interval).tv_usec=0;
- (value->it_value).tv_sec=1;
- (value->it_value).tv_usec=0;
-
- setitimer(timer,value,NULL);
-
- When tv_sec > 0, it's OK but ,
- when I try to generate an interruption before one second
- ( tv_sec = 0) and tv_usec = ??, my program emits it always
- at the same time : about 10 ms, ignoring tv_usec value.
-
- I think it's a classical problem (alarm() from UNIX library
- does it only with seconds), but I don't understand why ?
-
- Do you know a work around ?
-
- Thanks.
-
- tigli@mimosa.unice.fr
- I3S Laboratory, FRANCE
-
-