All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rddunlap@osdl.org>
To: matthias@corelatus.se
Cc: Arjan van de Ven <arjan@infradead.org>,
	Chris Wedgwood <cw@f00f.org>, Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: patch to fix set_itimer() behaviour in boundary cases
Date: Sat, 15 Jan 2005 15:39:20 -0800	[thread overview]
Message-ID: <41E9A9A8.5030602@osdl.org> (raw)
In-Reply-To: <16873.42607.937915.146208@antilipe.corelatus.se>

Matthias Lang wrote:
> Chris Wedgewood suggested handling this with a printk, to which Arjan
> van de Ven asked 
> 
>  > but why????
>  > 
>  > if someone wants the stuff rejected in a posix confirm way, he can do
>  > these tests easily in the syscall wrapper he needs anyway for this
>  > function.
> 
> For negative times and oversized usec values, that's easy. But the
> third problem was that setitimer() may silently truncate the time
> value. To deal with that, a wrapper would need to
> 
>   a) know that this silent truncation happens in the first place. 
>      The only way I know of finding that out is to read the kernel
>      source. (the man page doesn't say anything, and POSIX doesn't
>      mention any silent truncation either)
> 
> and
> 
>   b) Know that the particular value the truncation happens at is
>      dependent on HZ (and, presumably, know what HZ is on that
>      particular machine)
>  
> I found it surprising that the timer set by setitimer() could expire
> before the time passed to it---the manpage explicitly promises that
> will never happen. 
> 
> On many (most?) machines, the obvious symptoms of this truncation
> don't start appearing until after 248 days of uptime, so it's not the
> sort of problem which jumps out in testing. A printk() warning would
> have helped me. As would a warning in the manpage, e.g.:
> 
>    | BUGS
>    |
>    | Under Linux, timers will expire before the requested time if the
>    | requested time is larger than MAX_SEC_IN_JIFFIES, which is
>    | defined in include/linux/jiffies.h.
> 
> Where can I send manpage improvements?

aeb wrote on 2004-OCT-31:

Fortunately Michael Kerrisk has accepted to take over.
Send corrections and additions to mtk-manpages@gmx.net .

-- 
~Randy

  reply	other threads:[~2005-01-15 23:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-15  8:45 patch to fix set_itimer() behaviour in boundary cases Matthias Lang
2005-01-15  9:30 ` Andrew Morton
2005-01-15  9:36   ` William Lee Irwin III
2005-01-15  9:58     ` Arjan van de Ven
2005-01-15 10:07       ` William Lee Irwin III
2005-01-15 19:55       ` Chris Wedgwood
2005-01-15 20:20         ` Arjan van de Ven
2005-01-15 23:25           ` Matthias Lang
2005-01-15 23:39             ` Randy.Dunlap [this message]
2005-01-16  0:58   ` Alan Cox
2005-01-16 12:11     ` Arjan van de Ven
2005-01-19 23:51       ` George Anzinger
2005-01-20  8:07         ` Arjan van de Ven
2005-01-20 23:12           ` George Anzinger
2005-01-21  7:49             ` Arjan van de Ven
2005-01-21  8:22               ` George Anzinger

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=41E9A9A8.5030602@osdl.org \
    --to=rddunlap@osdl.org \
    --cc=akpm@osdl.org \
    --cc=arjan@infradead.org \
    --cc=cw@f00f.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthias@corelatus.se \
    /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.