At 02:04 PM 9/10/2003 -0400, John T. Williams wrote:
definitely higher then 2^16, I've got a process with the PID of 69917
I would guess MAX_INT which is 2^32 -1 = 4294967295

Actually, as it turns out, the right answer is "it depends".


Checking my kernel source, I find that the kernel's fork() routine checks against PID_MAX before wrapping. This value is defined, at least for 2.4.19, in <kernel_source_path>/include/linux/threads.h . My (Debian) kernel source has there

#define PID_MAX 0x8000

which matches my observed wrapping at (or near) 32768 . You might see if your kernel source sets this value higher.

----- Original Message -----
From: "Ray Olszewski" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 10, 2003 11:58 AM
Subject: Re: About PID...???!!!


> At 11:21 AM 9/10/2003 -0400, John T. Williams wrote: > >They are assigned linearly, however once a pid is used, it is never reused > >until the machine reboots. > > This is not quite correct. The pid assignment process wraps, I *think* at > 32767 (or maybe 65535). Next time around, the kernel skips over any pids > that are still in use from the last round of assignment.
[...]



-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to