Commit | Line | Data |
---|---|---|
b25797df KM |
1 | /* Copyright (c) 1979 Regents of the University of California */ |
2 | ||
3 | static char sccsid[] = "@(#)PMFLUSH.c 1.1 %G%"; | |
4 | ||
5 | #include "h00vars.h" | |
6 | ||
7 | PMFLUSH(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; | |
27 | ioerr: | |
28 | perror(PXPFILE); | |
29 | } |