svn commit: r244154 - head/bin/ps
Pawel Jakub Dawidek
pjd at FreeBSD.org
Fri Dec 14 21:41:09 UTC 2012
On Fri, Dec 14, 2012 at 11:52:15AM -0500, John Baldwin wrote:
> On Thursday, December 13, 2012 6:12:44 am Pawel Jakub Dawidek wrote:
> > On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote:
> > > On Wed, Dec 12, 2012 at 03:45:04PM +0000, Pawel Jakub Dawidek wrote:
> > > > Author: pjd
> > > > Date: Wed Dec 12 15:45:03 2012
> > > > New Revision: 244154
> > > > URL: http://svnweb.freebsd.org/changeset/base/244154
> > > >
> > > > Log:
> > > > Use kern.max_pid sysctl to obtain maximum PID number instead of using local
> > > > define.
> > > It is pid_max, not max_pid.
> > >
> > > But the change is wrong. The kern.pid_max only limits newly allocated pids,
> > > it does not magically moves existing pids, which are out of range, to the
> > > limited region. See the corresponding commit log for the description.
> > > It was added to make it easier to run FreeBSD 1.x binaries on the modern
> > > kernels.
> >
> > 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
>
> This doesn't help your actual use case though where you want to boot a kernel
> with a different PID_MAX. I would much rather our tools learn such constants
> from the kernel via sysctl than have them compiled in. So, I would add a new
> sysctl which exports the true PID_MAX constant (and is read-only and never
> changes) and use that in ps, etc.
In that case I'd prefer to make existing kern.pid_max sysctl read-only
and make it loader tunable. I don't expect there are many users of this
sysctl...
--
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-all/attachments/20121214/acb0f0f9/attachment.sig>
More information about the svn-src-all
mailing list