From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 04:44:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17943D35; Fri, 14 Dec 2012 04:44:17 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id B51308FC08; Fri, 14 Dec 2012 04:44:16 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 537D21A3C1B; Thu, 13 Dec 2012 20:44:15 -0800 (PST) Message-ID: <50CAAE9F.7030708@mu.org> Date: Thu, 13 Dec 2012 20:44:15 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Eitan Adler Subject: Re: svn commit: r244154 - head/bin/ps References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> <20121213161242.GE71906@kib.kiev.ua> <20121213165541.GD1381@garage.freebsd.pl> <20121213181621.GG71906@kib.kiev.ua> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , jhb@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 04:44:17 -0000 On 12/13/12 8:30 PM, Eitan Adler wrote: > On 13 December 2012 13:16, Konstantin Belousov wrote: >> On Thu, Dec 13, 2012 at 05:55:41PM +0100, Pawel Jakub Dawidek wrote: >>> On Thu, Dec 13, 2012 at 06:12:42PM +0200, Konstantin Belousov wrote: >>>> On Thu, Dec 13, 2012 at 12:12:44PM +0100, Pawel Jakub Dawidek wrote: >>>>> On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: >>>>> 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 >>>> Do you know why PID_MAX is under _KERNEL ? If there is no real reason, >>>> it would be better to move it outside kernel-only section. sys/proc.h >>>> is not in POSIX anyway. >>> I assumed it will break some ports that may define it themselves. >>> I wonder if we could do a test ports build to see what's the impact. >> Sure. >> >> On the other hand, sys/proc.h is mostly useless for the application code >> as it is now. Might be, use >> #ifndef PID_MAX >> braces ? > I think it makes more sense to unconditionally define it. A file > including sys/proc.h almost certainly wants the real PID_MAX. It > would be better to cause a pre-process time failure than to have it > silently hide the problem. > > > I'm thinking it's much better to make it a sysctl readonly (kern.pidmax), not a compile time thing. think about page_size and other things that can change. by making it dynamic you force better programming style at the slight expense of a few cycles of compile time optimization. -Alfred