From: george anzinger <george@mvista.com>
To: Eric Piel <Eric.Piel@Bull.Net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH]: DELAYTIMER_MAX is defined
Date: Tue, 06 May 2003 13:12:09 -0700 [thread overview]
Message-ID: <3EB81719.3050705@mvista.com> (raw)
In-Reply-To: <3EB7E3DA.C50258A9@Bull.Net>
Eric Piel wrote:
> Hello,
>
> Playing around with the posix timers I've noticed that DELAYTIMER_MAX is
> not defined. This constant is specified in the POSIX specifications. It
> should contain the maximum possible value of overruns on a signal. It is
> also said that the overrun shouldn't overflow. cf
> http://www.opengroup.org/onlinepubs/007904975/functions/timer_getoverrun.html
>
> So here is a patch to add this constant and a check that the overrun
> variable never overflow. It's for 2.5.67 but should apply flawlessly to
> 2.5.69 too.
> Actually one could wonder if the test on the overflow is really needed
> has an overrun reaching 2^31 seems very hard to happen. However the
> constant definition is not hurting anything and looks necessary for
> closer POSIX compliance.
I think this is needed in glibc. I am not sure how that relates to
kernel defines.
-g
>
> Eric
>
>
> ------------------------------------------------------------------------
>
> diff -ur linux-2.5.67-ia64-hrtcore/include/linux/limits.h linux-2.5.67-ia64-hrtimers/include/linux/limits.h
> --- linux-2.5.67-ia64-hrtcore/include/linux/limits.h 2003-04-22 11:10:44.000000000 +0200
> +++ linux-2.5.67-ia64-hrtimers/include/linux/limits.h 2003-05-06 13:45:48.000000000 +0200
> @@ -17,6 +17,8 @@
> #define XATTR_SIZE_MAX 65536 /* size of an extended attribute value (64k) */
> #define XATTR_LIST_MAX 65536 /* size of extended attribute namelist (64k) */
>
> +#define DELAYTIMER_MAX INT_MAX /* # timer expiration overruns a POSIX.1b timer may have */
> +
> #define RTSIG_MAX 32
>
> #endif
> diff -ur linux-2.5.67-ia64-hrtcore/include/linux/posix-timers.h linux-2.5.67-ia64-hrtimers/include/linux/posix-timers.h
> --- linux-2.5.67-ia64-hrtcore/include/linux/posix-timers.h 2003-04-22 11:10:44.000000000 +0200
> +++ linux-2.5.67-ia64-hrtimers/include/linux/posix-timers.h 2003-05-06 16:07:56.000000000 +0200
> @@ -25,6 +59,7 @@
>
> #define posix_bump_timer(timr) do { \
> (timr)->it_timer.expires += (timr)->it_incr; \
> - (timr)->it_overrun++; \
> + if ((timr)->it_overrun < DELAYTIMER_MAX)\
> + (timr)->it_overrun++; \
> }while (0)
> #endif
>
--
George Anzinger george@mvista.com
High-res-timers: http://sourceforge.net/projects/high-res-timers/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml
next prev parent reply other threads:[~2003-05-06 20:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-06 16:33 [PATCH]: DELAYTIMER_MAX is defined Eric Piel
2003-05-06 20:12 ` george anzinger [this message]
2003-05-07 7:29 ` Eric Piel
2003-05-07 7:48 ` Ulrich Drepper
2003-05-07 12:00 ` Eric Piel
2003-05-07 15:02 ` george anzinger
2003-05-07 18:21 ` Ulrich Drepper
2003-05-07 18:47 ` george anzinger
2003-05-07 19:03 ` Ulrich Drepper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3EB81719.3050705@mvista.com \
--to=george@mvista.com \
--cc=Eric.Piel@Bull.Net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.