merge in onyx changes
[unix-history] / usr / src / usr.bin / pascal / libpc / PMFLUSH.c
CommitLineData
b25797df
KM
1/* Copyright (c) 1979 Regents of the University of California */
2
492cc5d3 3static char sccsid[] = "@(#)PMFLUSH.c 1.3 %G%";
b25797df
KM
4
5#include "h00vars.h"
6
f87e8667 7PMFLUSH(cntrs, rtns, bufaddr)
b25797df 8
f87e8667
KM
9 long cntrs; /* total number of counters (stmt + routine) */
10 long rtns; /* number of func and proc counters */
11 long *bufaddr; /* address of count buffers */
b25797df
KM
12{
13 register FILE *filep;
14
f87e8667 15 bufaddr[0] = 0426;
492cc5d3 16 time(&bufaddr[1]);
f87e8667
KM
17 bufaddr[2] = cntrs;
18 bufaddr[3] = rtns;
b25797df
KM
19 filep = fopen(PXPFILE, "w");
20 if (filep == NULL)
21 goto ioerr;
492cc5d3 22 fwrite(bufaddr, (int)(cntrs + 1), sizeof(long), filep);
b25797df
KM
23 if (ferror(filep))
24 goto ioerr;
25 fclose(filep);
26 if (!ferror(filep))
27 return;
28ioerr:
29 perror(PXPFILE);
30}