getpid and clearPtrContainer were out-of-scope. Add unistd.h and pearl namespace to fix (seen on gcc 4.6+)