Q: How do I tell libc to refresh it's pid cache.

Eric W. Biederman ebiederm@xmission.com
Wed Aug 30 13:26:00 GMT 2006


I have been playing with implementing a user space a variation of fork
where the child process shows up on a remote machine.  Currently it
works fairly well, but getpid reports the pid of the process before
I copy it between machines.  Since in this instance I'm not trying to
hide the fact that the application moved between machines and
changed it's pid value this is a problem.

Is there a good way to have glibc refresh it's pid cache besides
calling fork an additional time?

If I could figure out how I would just write to the PID value,
But that variable appears not to be exported.  I'm single threaded
at the time so there shouldn't be any thread issues to make this
difficult.

I'm honestly confused at why we cache one of the cheapest syscalls,
but since we are how do I tell it to refresh it's cache?

Eric



More information about the Libc-alpha mailing list