|
|
1.1 ! root 1: #include <stdio.h> ! 2: #include <coff.h> ! 3: main(argc, argv) ! 4: int argc; ! 5: char *argv[]; ! 6: { ! 7: char *namelist; ! 8: SYMENT sym[3]; ! 9: int i; ! 10: ! 11: if (argc == 1) ! 12: namelist = "/autoboot"; ! 13: else ! 14: namelist = argv[1]; ! 15: /* ! 16: * Get the following values from the corefile: ! 17: * SHMMNI: max number of allowable shared memory segments ! 18: * NSEMID: max number of allowable semaphores ! 19: * NMSQID: max number of allowable message queues ! 20: */ ! 21: ! 22: /* Initialise SYMENT array */ ! 23: for (i = 0; i < 3; i++) { ! 24: sym[i]._n._n_n._n_zeroes = 0; /* stuff for coffnlist */ ! 25: sym[i].n_type = -1; ! 26: } ! 27: strcpy(sym[0].n_name, "SHMMNI"); ! 28: strcpy(sym[1].n_name, "NSEMID"); ! 29: strcpy(sym[2].n_name, "NMSQID"); ! 30: ! 31: /* do lookups. coffnlist returns 0 on error. */ ! 32: if (!coffnlist(namelist, sym, NULL, 3)) { ! 33: fprintf(stderr, "ipcs: error obtaining values from %s\n", ! 34: namelist); ! 35: exit(1); ! 36: } ! 37: ! 38: printf("%lx %lx %lx\n", sym[0].n_value, sym[1].n_value, sym[1].n_value); ! 39: printf("%d %d %d\n", sym[0].n_type, sym[1].n_type, sym[1].n_type); ! 40: ! 41: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.