I want to preserve a pid
In a program of mine, I've forked a new process. I want the pid of the new process to be preserved with the original parent program. In fact, I want it to be preserved even after the parent program has terminated, so that next time this program is executed, it knows the pid of the process that had been created in its previous execution (the user may want it to be 'killed', for which the pid is required). I know I can store the pid in a text file and later on read it, but that'll be quite risky, since anyone can alter the contents of the file, or even delete it. Is there some other way of retaining the pid?