title: gmon.out is not written after compiling with gcc -pg -g
body: <p>Compiled a C++ program using <code>gcc -pg -g</code> (at least, those are the args I gave in the Makefile; don't have any hard evidence of what command was executed).  Program ran to normal completion with CWD set to my home directory.  No gmon.out file written.</p>
  
  <p>gcc is 4.4.7. OS is centos 6.</p>
  
  <p>My program was launched by a hand-rolled Perl daemon using fork/exec.  I've verified that the CWD is my home directory, and that it's writeable, by having the daemon execute <code>touch foo</code> just before exec'ing my target program.  As far as I've been able to research, this shouldn't have affected the program's profiling or writing gmon.out when it terminated (normally).</p>