DataMuseum.dk

Presents historical artifacts from the history of:

Commodore CBM-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Commodore CBM-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦79b7f7d7c⟧ TextFile

    Length: 539 (0x21b)
    Types: TextFile
    Notes: UNIX file
    Names: »_prof.c«

Derivation

└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
    └─⟦f4b8d8c84⟧ UNIX V7 Filesystem
        └─ ⟦this⟧ »libc/crt/_prof.c« 

TextFile

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


#define	STDERR	2


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

	bufl = (unsigned)etext / 2;
	buf = (short *)sbrk(bufl * sizeof (short));
	if (buf == NULL) {
		write(STDERR, emsg, sizeof emsg);
		abort();
	}
	monitor((vaddr_t)1, (vaddr_t)etext, buf, bufl);
}


_profoff()
{
	monitor(NULL);
}