1: #ifndef lint 2: static char *sccsid = "@(#)profile.c 1.1 (Berkeley) 12/18/87"; 3: #endif 4: 5: #include <sys/types.h> 6: #include <sys/stat.h> 7: 8: #define MON "gmon.out" 9: #define DIR "/usr/tmp/nntpd.prof" 10: 11: profile() 12: { 13: static char tmp[] = "gmon.XXXXXX"; 14: struct stat statbuf; 15: 16: if (chdir(DIR) < 0) 17: return; 18: 19: if (stat(MON, statbuf) < 0) 20: return; 21: 22: (void) mktemp(tmp); 23: 24: (void) rename(MON, tmp); 25: }