What is the maximum value of the PID of a process?
Also, is it possible to change the PID of a running process?
On Linux, you can find the maximum PID value for your system with this:
This value can also be written using the same file. The maximum for 32 bit systems would be 32768, for 64 bit 4194304:
And no, you cannot change the PID of a running process. It gets assigned as a sequential number by the kernel at the time the process starts and that is it's identifier from that time on. The only thing you could do to get a new one is have your code fork a new process and terminate the old one.