Mail Archives: djgpp/2000/05/05/15:04:17
> From: Frederic Cazenave <cazenave AT radar DOT mcgill DOT ca>
> Date: Thu, 04 May 2000 20:23:48 GMT
>
> I have written a small progranm to test setitmer.
> It's appear this code run correctly on a unix system but
> not under DOS.
> Under UNIX the timer is reactivate every 10 seconds, but
> under dos the timer is active the first time but after is never
> reactivate.
I cannot reproduce this with your test program on my machine. On what
OS did you try this, and what version of DJGPP do you use?
I do see a small bug in the current version of setitimer, however.
The source patch is below; if you are using DJGPP v2.03, perhaps it
will solve your problem as well.
*** src/libc/posix/signal/itimer.c~0 Sun Nov 28 06:26:56 1999
--- src/libc/posix/signal/itimer.c Fri May 5 19:01:24 2000
*************** setitimer(int which, struct itimerval *v
*** 248,254 ****
if (usecs_min < 0)
usecs_min = DEFAULT_CLOCK_TICK_INTERVAL;
usecs = value->it_interval.tv_usec;
! if (value->it_interval.tv_sec == 0 && usecs < usecs_min)
usecs = usecs_min;
/* This doesn't overflow and doesn't cause any rounding errors,
--- 248,254 ----
if (usecs_min < 0)
usecs_min = DEFAULT_CLOCK_TICK_INTERVAL;
usecs = value->it_interval.tv_usec;
! if (value->it_interval.tv_sec == 0 && usecs && usecs < usecs_min)
usecs = usecs_min;
/* This doesn't overflow and doesn't cause any rounding errors,
- Raw text -