[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PID_MAX (was console hangs, but machine still up)
Kjell Wooding wrote:
> >I'll happily rebuild my kernel and see if that solves the problem,
> >but even so shouldn't the PID_MAX value be obeyed regardless of
> >which kernel I have? That is, even if it was defined as 99,999
> >when I built it, I should not be getting preposterous PIDs at
> >98573. Right? Or is there other application code that uses PID_MAX.
> >I.e. do I have to rebuild all the applications, socks, squid,
> >newsyslog, etc?
>
> No. It's the kernel that allocates the pid number, and does the check
> against PID_MAX. (ie - check in fork, execve, and so on).
I'm still a little confused - looking deeper into the
"newsyslog: preposterous process number" thing, we see
in newsyslog.c:
#define MIN_PID 4
[...]
else if (daemon_pid < MIN_PID)
warnx("preposterous process number: %d", daemon_pid);
daemon_pid is declared int (shouldn't this be pid_t?) and still
managed to get upset for 30000 < PID < 32766 from memory. However
I have only seen this once, I may be misremembering.
/* $OpenBSD: newsyslog.c,v 1.17 1999/01/05 00:43:44 deraadt Exp $ */
--
Phil Homewood DNRC email: philh@mincom.com
Postmaster and BOFH
Mincom Pty Ltd phone: +61-7-3303-3524
Brisbane, QLD Australia fax: +61-7-3303-3269