[comp.unix.ultrix] Can two processes have the same pid?

hegde@umvlsi.ecs.umass.edu (Uday Hegde) (06/11/90)

I noticed something peculiar sometime back on our system, which runs
ULTRIX-32 V3.1 (Rev. 9). I had a process, PID 29973, which had been
around for a couple of days and had been inherited by init. On trying
to kill that process, I got the message "not owner"

Doing a "ps" revealed that there was one other process, belonging to
some other user, which had pid 29973 and my process was still around!
I was unable to send any signals to my process as long as the other
process existed, but could stop, restart and terminate my process
after the other process with the same pid had terminated.

I am not sure if this matters, but since my process does a lot of
"sleep"ing, it was idle and had been swapped out when I noticed the
existence of duplicate PID's.

Is this behavior common among UNIX-like systems or is it a bug in ULTRIX?
I am curious as to how PIDs are allocated and under what circumstances
two processes end up with the same pid.

_______________________________________________________________________________
Uday Hegde                                Internet: hegde@cs.umass.edu
ECE, UMass Amherst                                  hegde@umvlsi.ecs.umass.edu
                                          Bitnet  : hegde@umass.bitnet