1*40865Sbostic /*- 2*40865Sbostic * Copyright (c) 1979 The Regents of the University of California. 3*40865Sbostic * All rights reserved. 4*40865Sbostic * 5*40865Sbostic * %sccs.include.redist.c% 6*40865Sbostic */ 71720Smckusick 8*40865Sbostic #ifndef lint 9*40865Sbostic static char sccsid[] = "@(#)PMFLUSH.c 1.4 (Berkeley) 04/09/90"; 10*40865Sbostic #endif /* not lint */ 111720Smckusick 121720Smckusick #include "h00vars.h" 131720Smckusick 142126Smckusic PMFLUSH(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