svn commit: r244154 - head/bin/ps

Pawel Jakub Dawidek pjd at FreeBSD.org
Wed Dec 12 16:42:31 UTC 2012


On Wed, Dec 12, 2012 at 11:37:00AM -0500, Eitan Adler wrote:
> On 12 December 2012 10:45, Pawel Jakub Dawidek <pjd at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20121212/884864ea/attachment.sig>


More information about the svn-src-head mailing list