First of all, let's return pid_t, which appears to be the correct type
given that we return PIDs, and it#s what fork() uses too.
Most importantly though, flush out our PID cache, so that the call
becomes compatible with our getpid_cached() logic.
static pid_t cached_pid = CACHED_PID_UNSET;
-static void reset_cached_pid(void) {
+void reset_cached_pid(void) {
/* Invoked in the child after a fork(), i.e. at the first moment the PID changed */
cached_pid = CACHED_PID_UNSET;
}
#endif // 0
pid_t getpid_cached(void);
+void reset_cached_pid(void);
int must_be_root(void);