BSD 4 release
[unix-history] / usr / src / lib / libpc / PMFLUSH.c
CommitLineData
b25797df
KM
1/* Copyright (c) 1979 Regents of the University of California */
2
31cef89c 3static char sccsid[] = "@(#)PMFLUSH.c 1.1 10/29/80";
b25797df
KM
4
5#include "h00vars.h"
6
7PMFLUSH(cntrs, rtns)
8
9 long cntrs; /* total number of counters (stmt + routine) */
10 long rtns; /* number of func and proc counters */
11{
12 register FILE *filep;
13
14 _pcpcount[0] = 0426;
15 _pcpcount[1] = time();
16 _pcpcount[2] = cntrs;
17 _pcpcount[3] = rtns;
18 filep = fopen(PXPFILE, "w");
19 if (filep == NULL)
20 goto ioerr;
21 fwrite(&_pcpcount[0], cntrs + 1, sizeof(long), filep);
22 if (ferror(filep))
23 goto ioerr;
24 fclose(filep);
25 if (!ferror(filep))
26 return;
27ioerr:
28 perror(PXPFILE);
29}