Why do you want to do this? Creating a pid does not guarantee that there is a process with that pid, or that will ever be a process with that pid, only a return from spawn
ensures that. Read the answers to Can someone explain the structure of a Pid in Erlang? to get an eplanation what the various fields mean. It will help explain why you can't just set it to any value.
You can set the size of the process table when you start erlang with the '+P Number' option. This gives the maximum value of the second field.
EDIT: Just some more comments about the question and the comments below.
Note that a pid, Process Identifier, is just a reference to a process, it is not the process itself. When you spawn
a process you get both a new process and a new pid referring to it. When you create a pid with either pid/3
in the shell or using list_to_pid/1
you get just a pid which may or may not refer to a process.
There is today no way in the BEAM to control which pid you get when you create a process. If you really need this functionality you would have to go in and modify the BEAM internally to do that. Considering the BEAM is structured internally (with a process table) and how a pid is structured that could be very difficult to do. For example one field in a pid is the index of the process in the process table so it is illegal to have to different pids with the same table index.
Wouldn't a better solution instead be to create an indentifier/pid table?