140865Sbostic /*- 2*62094Sbostic * Copyright (c) 1979, 1993 3*62094Sbostic * The Regents of the University of California. All rights reserved. 440865Sbostic * 540865Sbostic * %sccs.include.redist.c% 640865Sbostic */ 71720Smckusick 840865Sbostic #ifndef lint 9*62094Sbostic static char sccsid[] = "@(#)PMFLUSH.c 8.1 (Berkeley) 06/06/93"; 1040865Sbostic #endif /* not lint */ 111720Smckusick 121720Smckusick #include "h00vars.h" 131720Smckusick PMFLUSH(cntrs,rtns,bufaddr)142126SmckusicPMFLUSH(cntrs, rtns, bufaddr) 151720Smckusick 162126Smckusic long cntrs; /* total number of counters (stmt + routine) */ 172126Smckusic long rtns; /* number of func and proc counters */ 182126Smckusic long *bufaddr; /* address of count buffers */ 191720Smckusick { 201720Smckusick register FILE *filep; 211720Smckusick 222126Smckusic bufaddr[0] = 0426; 233017Smckusic time(&bufaddr[1]); 242126Smckusic bufaddr[2] = cntrs; 252126Smckusic bufaddr[3] = rtns; 261720Smckusick filep = fopen(PXPFILE, "w"); 271720Smckusick if (filep == NULL) 281720Smckusick goto ioerr; 293017Smckusic fwrite(bufaddr, (int)(cntrs + 1), sizeof(long), filep); 301720Smckusick if (ferror(filep)) 311720Smckusick goto ioerr; 321720Smckusick fclose(filep); 331720Smckusick if (!ferror(filep)) 341720Smckusick return; 351720Smckusick ioerr: 361720Smckusick perror(PXPFILE); 371720Smckusick } 38