How to set process ID in Linux for a specific program

后端 未结 6 938
后悔当初
后悔当初 2020-12-03 01:15

I was wondering if there is some way to force to use some specific process ID to Linux to some application before running it. I need to know in advance the process ID.

6条回答
  •  没有蜡笔的小新
    2020-12-03 02:00

    There's no way to force to use specific PID for process. As Wikipedia says:

    Process IDs are usually allocated on a sequential basis, beginning at 0 and rising to a maximum value which varies from system to system. Once this limit is reached, allocation restarts at 300 and again increases. In Mac OS X and HP-UX, allocation restarts at 100. However, for this and subsequent passes any PIDs still assigned to processes are skipped

提交回复
热议问题