File:  [MW Coherent from dump] / coherent / b / lib / libc / crt / i386 / _prof.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:35 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

/*
 * Called from the run-time start-off to enable profiling and to
 * write out the final profiling information.
 */
#include <stdio.h>
#include <sys/types.h>


#define	STDERR	2


_profon()
{
#ifndef	Z8001
	register unsigned	bufl;
	register short		*buf;
	extern			__end_text();
	static char		emsg[]	= "No room for profil buffer\n";

	bufl = (unsigned)__end_text / 2;
	buf = (short *)sbrk(bufl * sizeof (short));
	if (buf == NULL) {
		write(STDERR, emsg, sizeof emsg);
		abort();
	}
	monitor((caddr_t)1, (caddr_t)__end_text, buf, bufl);
#else
	monitor((caddr_t)1);		/* dummy call to start things off */
#endif
}


_profoff()
{
	monitor(NULL);
}


unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.