Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262361AbVAOXZt (ORCPT ); Sat, 15 Jan 2005 18:25:49 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262362AbVAOXZt (ORCPT ); Sat, 15 Jan 2005 18:25:49 -0500 Received: from av9-1-sn3.vrr.skanova.net ([81.228.9.185]:25270 "EHLO av9-1-sn3.vrr.skanova.net") by vger.kernel.org with ESMTP id S262361AbVAOXZi (ORCPT ); Sat, 15 Jan 2005 18:25:38 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16873.42607.937915.146208@antilipe.corelatus.se> Date: Sun, 16 Jan 2005 00:25:35 +0100 From: Matthias Lang To: Arjan van de Ven Cc: Chris Wedgwood , Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: patch to fix set_itimer() behaviour in boundary cases In-Reply-To: <1105820460.6300.86.camel@laptopd505.fenrus.org> References: <16872.55357.771948.196757@antilipe.corelatus.se> <20050115013013.1b3af366.akpm@osdl.org> <20050115093657.GI3474@holomorphy.com> <1105783125.6300.32.camel@laptopd505.fenrus.org> <20050115195504.GA10754@taniwha.stupidest.org> <1105820460.6300.86.camel@laptopd505.fenrus.org> X-Mailer: VM 7.17 under 21.4 (patch 16) "Corporate Culture" XEmacs Lucid Reply-To: matthias@corelatus.se Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1760 Lines: 48 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? Matthias - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/