Date: Wed, 12 Dec 2012 17:44:04 +0100 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: Eitan Adler <eadler@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r244154 - head/bin/ps Message-ID: <20121212164403.GE1381@garage.freebsd.pl> In-Reply-To: <CAF6rxgmH08e8kMYf920t8bZuZTTZAVhmS3ecvuhQ0xF%2BPAn34A@mail.gmail.com> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <CAF6rxgmH08e8kMYf920t8bZuZTTZAVhmS3ecvuhQ0xF%2BPAn34A@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <pjd@freebsd.org> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121212164403.GE1381>