PID in linux emulation

Malcolm Kay malcolm.kay at internode.on.net
Thu Nov 11 23:12:10 PST 2004


On Fri, 12 Nov 2004 02:17 am, Dan Nelson wrote:
> In the last episode (Nov 11), Malcolm Kay said:
> > I am attempting to run a commercial CAD software suite compiled for
> > Linux on a FreeBSD 4.10 OS. It runs as well or perhaps better than on
> > a Linux box until the PID becomes large.
> >
> > The MAX_PID for FreeBSD is 99999 while Linux has a limit of 0x8000.
>
> [...]
>
> > Can I edit in /usr/include/sys/proc.h and recompile the system
> > (kernel) for a lower MAX_PID? Will it work? Will it lead to other
> > complications? Is this where the kernel compilation obtains its
> > value?
>
> Sure.  You have to lower PID_MAX when running FreeBSD 2.x or ancient
> IBCS code, too.  There should be no ill effects.
>

Thanks, I'll give it a go.

> > Can MAX_PID be changed via sysctl?
> >
> > Is there someway to reset the current PID without rebooting?
>
> PID_MAX could be converted into a sysctl/boot-time tuneable without
> much trouble.  The kernel uses values above PID_MAX for thread ids, so
> I don't think moving the ceiling at runtime is a good idea.  Allowing
> it to be set to any value less than the boot-time limit should work
> fine, though.
>
> You also might want to ask your vendor to fix their hardcoded limit.
> There is no guarantee that the stock Linux kernel will use 16-bit pid
> values forever, and there is already a "pidhashing" patch that bumps it
> up to 4 million.

Yes, I'll probably do this -- but I can't really demand any action to 
support a non-Linux OS.

On the other hand the vendor has expressed some interest in my suggestion of a 
native FreeBSD version of his suite.

But of course thes things take time.

Malcolm



More information about the freebsd-questions mailing list