try to make display narrower
[unix-history] / usr / src / lib / libc / gmon / gmon.c
index 58c1b46..76a6d61 100644 (file)
@@ -1,4 +1,12 @@
-static char *sccsid = "@(#)gmon.c      4.13 (Berkeley) %G%";
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)gmon.c     5.4 (Berkeley) %G%";
+#endif LIBC_SCCS and not lint
 
 #ifdef DEBUG
 #include <stdio.h>
 
 #ifdef DEBUG
 #include <stdio.h>
@@ -48,12 +56,12 @@ monstartup(lowpc, highpc)
     monsize = (s_textsize / HISTFRACTION) + sizeof(struct phdr);
     buffer = sbrk( monsize );
     if ( buffer == (char *) -1 ) {
     monsize = (s_textsize / HISTFRACTION) + sizeof(struct phdr);
     buffer = sbrk( monsize );
     if ( buffer == (char *) -1 ) {
-       write( 2 , MSG , sizeof(MSG) );
+       write( 2 , MSG , sizeof(MSG) - 1 );
        return;
     }
     froms = (unsigned short *) sbrk( s_textsize / HASHFRACTION );
     if ( froms == (unsigned short *) -1 ) {
        return;
     }
     froms = (unsigned short *) sbrk( s_textsize / HASHFRACTION );
     if ( froms == (unsigned short *) -1 ) {
-       write( 2 , MSG , sizeof(MSG) );
+       write( 2 , MSG , sizeof(MSG) - 1 );
        froms = 0;
        return;
     }
        froms = 0;
        return;
     }
@@ -65,7 +73,7 @@ monstartup(lowpc, highpc)
     }
     tos = (struct tostruct *) sbrk( tolimit * sizeof( struct tostruct ) );
     if ( tos == (struct tostruct *) -1 ) {
     }
     tos = (struct tostruct *) sbrk( tolimit * sizeof( struct tostruct ) );
     if ( tos == (struct tostruct *) -1 ) {
-       write( 2 , MSG , sizeof(MSG) );
+       write( 2 , MSG , sizeof(MSG) - 1 );
        froms = 0;
        tos = 0;
        return;
        froms = 0;
        tos = 0;
        return;
@@ -126,10 +134,6 @@ mcount()
        register struct tostruct        *prevtop;       /* r8  => r2 */
        register long                   toindex;        /* r7  => r1 */
 
        register struct tostruct        *prevtop;       /* r8  => r2 */
        register long                   toindex;        /* r7  => r1 */
 
-#ifdef lint
-       selfpc = (char *)0;
-       frompcindex = 0;
-#else not lint
        /*
         *      find the return address for mcount,
         *      and the return address for mcount's caller.
        /*
         *      find the return address for mcount,
         *      and the return address for mcount's caller.
@@ -137,7 +141,6 @@ mcount()
        asm("   .text");                /* make sure we're in text space */
        asm("   movl (sp), r11");       /* selfpc = ... (jsb frame) */
        asm("   movl 16(fp), r10");     /* frompcindex =     (calls frame) */
        asm("   .text");                /* make sure we're in text space */
        asm("   movl (sp), r11");       /* selfpc = ... (jsb frame) */
        asm("   movl 16(fp), r10");     /* frompcindex =     (calls frame) */
-#endif not lint
        /*
         *      check that we are profiling
         *      and that we aren't recursively invoked.
        /*
         *      check that we are profiling
         *      and that we aren't recursively invoked.
@@ -235,7 +238,7 @@ out:
 overflow:
        profiling++; /* halt further profiling */
 #   define     TOLIMIT "mcount: tos overflow\n"
 overflow:
        profiling++; /* halt further profiling */
 #   define     TOLIMIT "mcount: tos overflow\n"
-       write(2, TOLIMIT, sizeof(TOLIMIT));
+       write(2, TOLIMIT, sizeof(TOLIMIT) - 1);
        goto out;
 }
 asm(".text");
        goto out;
 }
 asm(".text");