From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 16:42:31 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 C7690F9E; Wed, 12 Dec 2012 16:42:31 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id C59E88FC17; Wed, 12 Dec 2012 16:42:30 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id DAAEFC0; Wed, 12 Dec 2012 17:40:27 +0100 (CET) Date: Wed, 12 Dec 2012 17:44:04 +0100 From: Pawel Jakub Dawidek To: Eitan Adler Subject: Re: svn commit: r244154 - head/bin/ps Message-ID: <20121212164403.GE1381@garage.freebsd.pl> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="84ND8YJRMFlzkrP4" Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: 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: Wed, 12 Dec 2012 16:42:31 -0000 --84ND8YJRMFlzkrP4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 12, 2012 at 11:37:00AM -0500, Eitan Adler wrote: > On 12 December 2012 10:45, Pawel Jakub Dawidek wrote: >=20 > > + if (sysctlbyname("kern.pid_max", &pid_max, &intsize, NULL, 0) <= 0) { > > + warn("unable to read kern.pid_max"); >=20 > Silly question, when could this fail and not be fatal? It isn't fatal, we can easly make some assumptions instead of turning ps(1) unusable. Currently it will be hard to make it fail, which doesn't mean we shouldn't handle this case. Some day it might fail for some reason (someone changed sysctl name?). > > + pid_max =3D 99999; >=20 > Why not use PID_MAX from sys/proc.h? Because we are in userland and PID_MAX is only defined for the kernel. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --84ND8YJRMFlzkrP4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDItFMACgkQForvXbEpPzTPzQCgx1koy5dhIl3zhl6y6lfH7i5w Jt8AoOVpPZEYYTwn8bZKqTit8pv3F9jg =spSU -----END PGP SIGNATURE----- --84ND8YJRMFlzkrP4--