From owner-freebsd-stable@FreeBSD.ORG Sun Mar 13 16:25:35 2005 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 861E116A4CE for ; Sun, 13 Mar 2005 16:25:35 +0000 (GMT) Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id A9DBC43D41 for ; Sun, 13 Mar 2005 16:25:34 +0000 (GMT) (envelope-from jilles@stack.nl) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mailhost.stack.nl (Postfix) with ESMTP id B7CD61F233; Sun, 13 Mar 2005 17:25:33 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id A76881DAAA; Sun, 13 Mar 2005 17:25:33 +0100 (CET) Date: Sun, 13 Mar 2005 17:25:33 +0100 From: Jilles Tjoelker To: Jon Noack Message-ID: <20050313162533.GA14952@stack.nl> References: <4231FC02.8050205@alumni.rice.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4231FC02.8050205@alumni.rice.edu> X-Operating-System: FreeBSD 5.3-RELEASE-p2 i386 User-Agent: Mutt/1.5.6i cc: stable@FreeBSD.ORG cc: Pete French Subject: Re: Just a sanity check before I sumbit a buig report X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2005 16:25:35 -0000 On Fri, Mar 11, 2005 at 02:13:54PM -0600, Jon Noack wrote: > Pete French wrote: > >>Why does sysconf(_SC_CLK_TCK) always returns 128? Check out sysconf() > >>in src/lib/libc/gen/sysconf.c (lines 83-84 of rev. 1.10): > >[follow through of code showing it is defined as a constant snipped] > sysconf(3) states that _SC_CLK_TCK is the "frequency of the statistics > clock in ticks per second." Considering this value varies, returning a > constant is wrong. Feel free to attach my email on the PR. An important use for sysconf(_SC_CLK_TCK) is to specify the rate of the results of times(3). (I don't know how many applications call that stupid function, getrusage() having been available for so long ;-) Currently, src/lib/libc/gen/times.c compiles this in just like sysconf.c does. So that's all ok; times.c will have to be modified too if sysconf(_SC_CLK_TCK) changes. getrusage(2) says that ru_ixrss is based on "statistics clock ticks" with a frequency of sysconf(_SC_CLK_TCK). This cannot be right. In other systems, getrusage often only really supports the timeval fields and perhaps the fault and swap counts; if it is supported, the ru_i?rss ticks are often not described at all or they are something strange like one per second. Consequently, this facility is nonportable and the tick frequency should be described using sysctl(). -- Jilles Tjoelker