Cygwin: pinfo: raise MAX_PID to 4194304

Reportedly, the maximum pid of 65536 is much too small in bigger
environments.  Raise the maximum PID to 4194304, whihc is the maximum
pid on Linux (PID_MAX_LIMIT defined in include/linux/threads.h).

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2024-12-19 19:52:56 +01:00
parent 67bef16f7e
commit 363357c023
3 changed files with 6 additions and 2 deletions

View file

@ -223,7 +223,7 @@ private:
DWORD status_exit (DWORD);
};
#define MAX_PID 65536
#define MAX_PID 4194304
#define ISSTATE(p, f) (!!((p)->process_state & f))
#define NOTSTATE(p, f) (!((p)->process_state & f))

View file

@ -239,7 +239,7 @@ pinfo::exit (DWORD n)
}
# undef self
/* Return next free Cygwin PID between 2 and 65535, round-robin. Each new
/* Return next free Cygwin PID between 2 and MAX_PID, round-robin. Each new
PID is checked that it doesn't collide with an existing PID. For that,
just check if the "cygpid.PID" section exists. */
pid_t

View file

@ -74,3 +74,7 @@ What changed:
'(18) priority' is now set to the negated sched_policy minus one.
If SCHED_IDLE is selected, this field is set to 39. The '(19) nice'
field is now set to the originally requested nice value.
- Raise maximum pid from 65536 to 4194304 to account for scenarios
with lots of CPUs and lots of tasks.
Addresses: https://cygwin.com/pipermail/cygwin/2024-December/256927.html