> Can you think of a better way?

Hum, I'm afraid not.  The only reasonably robust scheme I could come up with involves stat'ing /proc/self and saving st_ino, st_ctim and maybe some other fields; they change across invocations.  A (pid, st_ino, st_ctim) tuple should be pretty unique, even in the event of clock skew.

Of course that will only work on systems that have a procfs mounted (most Linux and Solaris installs; not OS X and neither most FreeBSD systems) so it's still a sub-standard solution.

Another hack that could conceivably work (but is too hideous to seriously consider) is creating a UNIX socket in the master and sending the file descriptor to the child process.  When the child process quits, the socket becomes stale; when you connect to it, you'll get an error and know the process has gone away.  Like I said, hideous.