File:  [Research Unix] / researchv8dc / netfs / profit.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:59 2018 UTC (18 months, 4 weeks ago) by root
Branches: belllabs, MAIN
CVS tags: researchv8, HEAD
researchv8 Dan Cross

#include "stdio.h"
#include "signal.h"
struct rec {
	long len;
	struct rec *next;
	char *fname;
	long cnt[1];
} *proFptr = (struct rec *)-1;	/* end of list marker */
profit()
{	int i;
	FILE *fd;
	struct rec *x = proFptr;
	fd = fopen("/etc/net/prof.out", "w");
	if(fd == NULL)
		fd = fopen("/usr/net/prof.out", "w");
	while(x != (struct rec *)-1) {
		fprintf(fd, "%s\n", x->fname);
		for(i = 3; i < x->len; i++)
			fprintf(fd, "%d\n", x->cnt[i-3]);
		x = x->next;
	}
	fflush(fd);
	fclose(fd);
	signal(SIGTERM, profit);
}

unix.superglobalmegacorp.com