Annotation of researchv10dc/cmd/usgmake/prtmem.c, revision 1.1.1.1

1.1       root        1: /*      @(#)/usr/src/cmd/make/prtmem.c  3.3     */
                      2: 
                      3: #ifdef GETU
                      4: #define udsize u[0]
                      5: #define ussize u[1]
                      6: #endif
                      7: 
                      8: 
                      9: prtmem()
                     10: {
                     11: #ifdef GETU
                     12: #include "stdio.h"
                     13: #include "sys/param.h"
                     14: #include "sys/user.h"
                     15:         unsigned u[2];
                     16:         register int i;
                     17: 
                     18:         if(getu( &(struct user *)0->u_dsize, &u, sizeof u) > 0)
                     19:         {
                     20:                 udsize *= 64;
                     21:                 ussize *= 64;
                     22:                 printf("mem: data = %u(0%o) stack = %u(0%o)\n",
                     23:                         udsize, udsize, ussize, ussize);
                     24: /*
                     25:  *      The following works only when `make' is compiled
                     26:  *      with I&D space separated (i.e. cc -i ...).
                     27:  *      (Notice the hard coded `65' below!)
                     28:  */
                     29:                 udsize /= 1000;
                     30:                 ussize /= 1000;
                     31:                 printf("mem:");
                     32:                 for(i=1; i<=udsize;i++)
                     33:                 {
                     34:                         if((i%10) == 0)
                     35:                                 printf("___");
                     36:                         printf("d");
                     37:                 }
                     38:                 for(;i<=65-ussize;i++)
                     39:                 {
                     40:                         if((i%10) == 0)
                     41:                                 printf("___");
                     42:                         printf(".");
                     43:                 }
                     44:                 for(;i<=65;i++)
                     45:                 {
                     46:                         if((i%10) == 0)
                     47:                                 printf("___");
                     48:                         printf("s");
                     49:                 }
                     50:                 printf("\n");
                     51:                 fflush(stdout);
                     52:         }
                     53: #endif
                     54: }

unix.superglobalmegacorp.com

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