home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / N / TCPIP / NNTP-1.000 / NNTP-1 / nntp.1.5.11t / server / profile.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-17  |  381 b   |  26 lines

  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. }
  26.