summaryrefslogtreecommitdiff
path: root/usr.bin/ipcs/ipcs.c
diff options
context:
space:
mode:
authorEitan Adler <eadler@FreeBSD.org>2015-04-13 19:58:11 +0000
committerEitan Adler <eadler@FreeBSD.org>2015-04-13 19:58:11 +0000
commit11f4012fa1b74ad0c5bb33f85ac1e712f818f840 (patch)
tree63bb0ac6f500c71d5d9ce932b2fd966b4257ae63 /usr.bin/ipcs/ipcs.c
parent0eeac589304be9ae1f8e4d2bc0c4575cf001cd6b (diff)
downloadsrc-test2-11f4012fa1b74ad0c5bb33f85ac1e712f818f840.tar.gz
src-test2-11f4012fa1b74ad0c5bb33f85ac1e712f818f840.zip
Notes
Diffstat (limited to 'usr.bin/ipcs/ipcs.c')
-rw-r--r--usr.bin/ipcs/ipcs.c55
1 files changed, 28 insertions, 27 deletions
diff --git a/usr.bin/ipcs/ipcs.c b/usr.bin/ipcs/ipcs.c
index 1d8e3549245f..be6ca5616f59 100644
--- a/usr.bin/ipcs/ipcs.c
+++ b/usr.bin/ipcs/ipcs.c
@@ -112,6 +112,7 @@ main(int argc, char *argv[])
char *core = NULL, *user = NULL, *namelist = NULL;
char kvmoferr[_POSIX2_LINE_MAX]; /* Error buf for kvm_openfiles. */
int i;
+ u_long shmidx;
uid_t uid = 0;
while ((i = getopt(argc, argv, "MmQqSsabC:cN:optTu:y")) != -1)
@@ -247,13 +248,13 @@ main(int argc, char *argv[])
print_kshmheader(option);
- for (i = 0; i < shminfo.shmmni; i += 1) {
- if (kxshmids[i].u.shm_perm.mode & 0x0800) {
+ for (shmidx = 0; shmidx < shminfo.shmmni; shmidx += 1) {
+ if (kxshmids[shmidx].u.shm_perm.mode & 0x0800) {
if (user &&
- uid != kxshmids[i].u.shm_perm.uid)
+ uid != kxshmids[shmidx].u.shm_perm.uid)
continue;
- print_kshmptr(i, option, &kxshmids[i]);
+ print_kshmptr(shmidx, option, &kxshmids[shmidx]);
}
}
printf("\n");
@@ -309,22 +310,22 @@ main(int argc, char *argv[])
}
void
-print_kmsqtotal(struct msginfo msginfo)
+print_kmsqtotal(struct msginfo local_msginfo)
{
printf("msginfo:\n");
printf("\tmsgmax: %12d\t(max characters in a message)\n",
- msginfo.msgmax);
+ local_msginfo.msgmax);
printf("\tmsgmni: %12d\t(# of message queues)\n",
- msginfo.msgmni);
+ local_msginfo.msgmni);
printf("\tmsgmnb: %12d\t(max characters in a message queue)\n",
- msginfo.msgmnb);
+ local_msginfo.msgmnb);
printf("\tmsgtql: %12d\t(max # of messages in system)\n",
- msginfo.msgtql);
+ local_msginfo.msgtql);
printf("\tmsgssz: %12d\t(size of a message segment)\n",
- msginfo.msgssz);
+ local_msginfo.msgssz);
printf("\tmsgseg: %12d\t(# of message segments in system)\n\n",
- msginfo.msgseg);
+ local_msginfo.msgseg);
}
void print_kmsqheader(int option)
@@ -390,20 +391,20 @@ print_kmsqptr(int i, int option, struct msqid_kernel *kmsqptr)
}
void
-print_kshmtotal(struct shminfo shminfo)
+print_kshmtotal(struct shminfo local_shminfo)
{
printf("shminfo:\n");
printf("\tshmmax: %12lu\t(max shared memory segment size)\n",
- shminfo.shmmax);
+ local_shminfo.shmmax);
printf("\tshmmin: %12lu\t(min shared memory segment size)\n",
- shminfo.shmmin);
+ local_shminfo.shmmin);
printf("\tshmmni: %12lu\t(max number of shared memory identifiers)\n",
- shminfo.shmmni);
+ local_shminfo.shmmni);
printf("\tshmseg: %12lu\t(max shared memory segments per process)\n",
- shminfo.shmseg);
+ local_shminfo.shmseg);
printf("\tshmall: %12lu\t(max amount of shared memory in pages)\n\n",
- shminfo.shmall);
+ local_shminfo.shmall);
}
void
@@ -470,28 +471,28 @@ print_kshmptr(int i, int option, struct shmid_kernel *kshmptr)
}
void
-print_ksemtotal(struct seminfo seminfo)
+print_ksemtotal(struct seminfo local_seminfo)
{
printf("seminfo:\n");
printf("\tsemmni: %12d\t(# of semaphore identifiers)\n",
- seminfo.semmni);
+ local_seminfo.semmni);
printf("\tsemmns: %12d\t(# of semaphores in system)\n",
- seminfo.semmns);
+ local_seminfo.semmns);
printf("\tsemmnu: %12d\t(# of undo structures in system)\n",
- seminfo.semmnu);
+ local_seminfo.semmnu);
printf("\tsemmsl: %12d\t(max # of semaphores per id)\n",
- seminfo.semmsl);
+ local_seminfo.semmsl);
printf("\tsemopm: %12d\t(max # of operations per semop call)\n",
- seminfo.semopm);
+ local_seminfo.semopm);
printf("\tsemume: %12d\t(max # of undo entries per process)\n",
- seminfo.semume);
+ local_seminfo.semume);
printf("\tsemusz: %12d\t(size in bytes of undo structure)\n",
- seminfo.semusz);
+ local_seminfo.semusz);
printf("\tsemvmx: %12d\t(semaphore maximum value)\n",
- seminfo.semvmx);
+ local_seminfo.semvmx);
printf("\tsemaem: %12d\t(adjust on exit max value)\n\n",
- seminfo.semaem);
+ local_seminfo.semaem);
}
void