From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 17:09:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8361E280; Fri, 14 Dec 2012 17:09:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 51CA68FC1B; Fri, 14 Dec 2012 17:09:41 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C6B71B9A8; Fri, 14 Dec 2012 12:09:40 -0500 (EST) From: John Baldwin To: Pawel Jakub Dawidek Subject: Re: svn commit: r244154 - head/bin/ps Date: Fri, 14 Dec 2012 11:52:15 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> In-Reply-To: <20121213111240.GB1381@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201212141152.15567.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 14 Dec 2012 12:09:40 -0500 (EST) Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 17:09:41 -0000 On Thursday, December 13, 2012 6:12:44 am Pawel Jakub Dawidek wrote: > On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: > > On Wed, Dec 12, 2012 at 03:45:04PM +0000, Pawel Jakub Dawidek wrote: > > > Author: pjd > > > Date: Wed Dec 12 15:45:03 2012 > > > New Revision: 244154 > > > URL: http://svnweb.freebsd.org/changeset/base/244154 > > > > > > Log: > > > Use kern.max_pid sysctl to obtain maximum PID number instead of using local > > > define. > > It is pid_max, not max_pid. > > > > But the change is wrong. The kern.pid_max only limits newly allocated pids, > > it does not magically moves existing pids, which are out of range, to the > > limited region. See the corresponding commit log for the description. > > It was added to make it easier to run FreeBSD 1.x binaries on the modern > > kernels. > > I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... > How about defining BSD_PID_MAX in sys/proc.h, which would be visible by > userland as well and setting PID_MAX to BSD_PID_MAX? > > This would also help bsnmpd. > > http://people.freebsd.org/~pjd/patches/PID_MAX.patch This doesn't help your actual use case though where you want to boot a kernel with a different PID_MAX. I would much rather our tools learn such constants from the kernel via sysctl than have them compiled in. So, I would add a new sysctl which exports the true PID_MAX constant (and is read-only and never changes) and use that in ps, etc. -- John Baldwin