On Wed, Dec 12, 2012 at 11:37:00AM -0500, Eitan Adler wrote:
> On 12 December 2012 10:45, Pawel Jakub Dawidek <p...@freebsd.org> wrote:
> 
> > +       if (sysctlbyname("kern.pid_max", &pid_max, &intsize, NULL, 0) < 0) {
> > +               warn("unable to read kern.pid_max");
> 
> 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 = 99999;
> 
> Why not use PID_MAX from sys/proc.h?

Because we are in userland and PID_MAX is only defined for the kernel.

-- 
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://tupytaj.pl

Attachment: pgppOFYrdKMf4.pgp
Description: PGP signature

Reply via email to