diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2013-01-14 01:34:48 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-01-14 01:34:48 +0100 |
| commit | 6967578728a3eef43b7b2be4080dafc1b87f528d (patch) | |
| tree | 76b79c4c81ce8e5ad4e57df5119efecef810e673 /util-linux/ipcs.c | |
| parent | 52185155088d0910d29c7f4fdf5cb3eecaac8965 (diff) | |
| download | busybox-w32-6967578728a3eef43b7b2be4080dafc1b87f528d.tar.gz busybox-w32-6967578728a3eef43b7b2be4080dafc1b87f528d.tar.bz2 busybox-w32-6967578728a3eef43b7b2be4080dafc1b87f528d.zip | |
whitespace fixes. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux/ipcs.c')
| -rw-r--r-- | util-linux/ipcs.c | 254 |
1 files changed, 127 insertions, 127 deletions
diff --git a/util-linux/ipcs.c b/util-linux/ipcs.c index ee7df5e33..8fdaf0b85 100644 --- a/util-linux/ipcs.c +++ b/util-linux/ipcs.c | |||
| @@ -154,52 +154,52 @@ static NOINLINE void do_shm(void) | |||
| 154 | /* glibc 2.1.3 and all earlier libc's have ints as fields | 154 | /* glibc 2.1.3 and all earlier libc's have ints as fields |
| 155 | of struct shminfo; glibc 2.1.91 has unsigned long; ach */ | 155 | of struct shminfo; glibc 2.1.91 has unsigned long; ach */ |
| 156 | printf("max number of segments = %lu\n" | 156 | printf("max number of segments = %lu\n" |
| 157 | "max seg size (kbytes) = %lu\n" | 157 | "max seg size (kbytes) = %lu\n" |
| 158 | "max total shared memory (pages) = %lu\n" | 158 | "max total shared memory (pages) = %lu\n" |
| 159 | "min seg size (bytes) = %lu\n", | 159 | "min seg size (bytes) = %lu\n", |
| 160 | (unsigned long) shminfo.shmmni, | 160 | (unsigned long) shminfo.shmmni, |
| 161 | (unsigned long) (shminfo.shmmax >> 10), | 161 | (unsigned long) (shminfo.shmmax >> 10), |
| 162 | (unsigned long) shminfo.shmall, | 162 | (unsigned long) shminfo.shmall, |
| 163 | (unsigned long) shminfo.shmmin); | 163 | (unsigned long) shminfo.shmmin); |
| 164 | return; | 164 | return; |
| 165 | 165 | ||
| 166 | case STATUS: | 166 | case STATUS: |
| 167 | printf("------ Shared Memory %s --------\n", "Status"); | 167 | printf("------ Shared Memory %s --------\n", "Status"); |
| 168 | printf( "segments allocated %d\n" | 168 | printf("segments allocated %d\n" |
| 169 | "pages allocated %ld\n" | 169 | "pages allocated %ld\n" |
| 170 | "pages resident %ld\n" | 170 | "pages resident %ld\n" |
| 171 | "pages swapped %ld\n" | 171 | "pages swapped %ld\n" |
| 172 | "Swap performance: %ld attempts\t%ld successes\n", | 172 | "Swap performance: %ld attempts\t%ld successes\n", |
| 173 | shm_info.used_ids, | 173 | shm_info.used_ids, |
| 174 | shm_info.shm_tot, | 174 | shm_info.shm_tot, |
| 175 | shm_info.shm_rss, | 175 | shm_info.shm_rss, |
| 176 | shm_info.shm_swp, | 176 | shm_info.shm_swp, |
| 177 | shm_info.swap_attempts, shm_info.swap_successes); | 177 | shm_info.swap_attempts, shm_info.swap_successes); |
| 178 | return; | 178 | return; |
| 179 | 179 | ||
| 180 | case CREATOR: | 180 | case CREATOR: |
| 181 | printf("------ Shared Memory %s --------\n", "Segment Creators/Owners"); | 181 | printf("------ Shared Memory %s --------\n", "Segment Creators/Owners"); |
| 182 | printf( "%-10s %-10s %-10s %-10s %-10s %-10s\n", | 182 | printf("%-10s %-10s %-10s %-10s %-10s %-10s\n", |
| 183 | "shmid", "perms", "cuid", "cgid", "uid", "gid"); | 183 | "shmid", "perms", "cuid", "cgid", "uid", "gid"); |
| 184 | break; | 184 | break; |
| 185 | 185 | ||
| 186 | case TIME: | 186 | case TIME: |
| 187 | printf("------ Shared Memory %s --------\n", "Attach/Detach/Change Times"); | 187 | printf("------ Shared Memory %s --------\n", "Attach/Detach/Change Times"); |
| 188 | printf( "%-10s %-10s %-20s %-20s %-20s\n", | 188 | printf("%-10s %-10s %-20s %-20s %-20s\n", |
| 189 | "shmid", "owner", "attached", "detached", "changed"); | 189 | "shmid", "owner", "attached", "detached", "changed"); |
| 190 | break; | 190 | break; |
| 191 | 191 | ||
| 192 | case PID: | 192 | case PID: |
| 193 | printf("------ Shared Memory %s --------\n", "Creator/Last-op"); | 193 | printf("------ Shared Memory %s --------\n", "Creator/Last-op"); |
| 194 | printf( "%-10s %-10s %-10s %-10s\n", | 194 | printf("%-10s %-10s %-10s %-10s\n", |
| 195 | "shmid", "owner", "cpid", "lpid"); | 195 | "shmid", "owner", "cpid", "lpid"); |
| 196 | break; | 196 | break; |
| 197 | 197 | ||
| 198 | default: | 198 | default: |
| 199 | printf("------ Shared Memory %s --------\n", "Segments"); | 199 | printf("------ Shared Memory %s --------\n", "Segments"); |
| 200 | printf( "%-10s %-10s %-10s %-10s %-10s %-10s %-12s\n", | 200 | printf("%-10s %-10s %-10s %-10s %-10s %-10s %-12s\n", |
| 201 | "key", "shmid", "owner", "perms", "bytes", "nattch", | 201 | "key", "shmid", "owner", "perms", "bytes", "nattch", |
| 202 | "status"); | 202 | "status"); |
| 203 | break; | 203 | break; |
| 204 | } | 204 | } |
| 205 | 205 | ||
| @@ -220,11 +220,11 @@ static NOINLINE void do_shm(void) | |||
| 220 | printf("%-10d %-10d", shmid, ipcp->uid); | 220 | printf("%-10d %-10d", shmid, ipcp->uid); |
| 221 | /* ctime uses static buffer: use separate calls */ | 221 | /* ctime uses static buffer: use separate calls */ |
| 222 | printf(" %-20.16s", shmseg.shm_atime | 222 | printf(" %-20.16s", shmseg.shm_atime |
| 223 | ? ctime(&shmseg.shm_atime) + 4 : "Not set"); | 223 | ? ctime(&shmseg.shm_atime) + 4 : "Not set"); |
| 224 | printf(" %-20.16s", shmseg.shm_dtime | 224 | printf(" %-20.16s", shmseg.shm_dtime |
| 225 | ? ctime(&shmseg.shm_dtime) + 4 : "Not set"); | 225 | ? ctime(&shmseg.shm_dtime) + 4 : "Not set"); |
| 226 | printf(" %-20.16s\n", shmseg.shm_ctime | 226 | printf(" %-20.16s\n", shmseg.shm_ctime |
| 227 | ? ctime(&shmseg.shm_ctime) + 4 : "Not set"); | 227 | ? ctime(&shmseg.shm_ctime) + 4 : "Not set"); |
| 228 | break; | 228 | break; |
| 229 | case PID: | 229 | case PID: |
| 230 | if (pw) | 230 | if (pw) |
| @@ -241,17 +241,17 @@ static NOINLINE void do_shm(void) | |||
| 241 | else | 241 | else |
| 242 | printf("%-10d %-10d", shmid, ipcp->uid); | 242 | printf("%-10d %-10d", shmid, ipcp->uid); |
| 243 | printf(" %-10o %-10lu %-10ld %-6s %-6s\n", ipcp->mode & 0777, | 243 | printf(" %-10o %-10lu %-10ld %-6s %-6s\n", ipcp->mode & 0777, |
| 244 | /* | 244 | /* |
| 245 | * earlier: int, Austin has size_t | 245 | * earlier: int, Austin has size_t |
| 246 | */ | 246 | */ |
| 247 | (unsigned long) shmseg.shm_segsz, | 247 | (unsigned long) shmseg.shm_segsz, |
| 248 | /* | 248 | /* |
| 249 | * glibc-2.1.3 and earlier has unsigned short; | 249 | * glibc-2.1.3 and earlier has unsigned short; |
| 250 | * Austin has shmatt_t | 250 | * Austin has shmatt_t |
| 251 | */ | 251 | */ |
| 252 | (long) shmseg.shm_nattch, | 252 | (long) shmseg.shm_nattch, |
| 253 | ipcp->mode & SHM_DEST ? "dest" : " ", | 253 | ipcp->mode & SHM_DEST ? "dest" : " ", |
| 254 | ipcp->mode & SHM_LOCKED ? "locked" : " "); | 254 | ipcp->mode & SHM_LOCKED ? "locked" : " "); |
| 255 | break; | 255 | break; |
| 256 | } | 256 | } |
| 257 | } | 257 | } |
| @@ -281,32 +281,32 @@ static NOINLINE void do_sem(void) | |||
| 281 | if ((semctl(0, 0, IPC_INFO, arg)) < 0) | 281 | if ((semctl(0, 0, IPC_INFO, arg)) < 0) |
| 282 | return; | 282 | return; |
| 283 | printf("max number of arrays = %d\n" | 283 | printf("max number of arrays = %d\n" |
| 284 | "max semaphores per array = %d\n" | 284 | "max semaphores per array = %d\n" |
| 285 | "max semaphores system wide = %d\n" | 285 | "max semaphores system wide = %d\n" |
| 286 | "max ops per semop call = %d\n" | 286 | "max ops per semop call = %d\n" |
| 287 | "semaphore max value = %d\n", | 287 | "semaphore max value = %d\n", |
| 288 | seminfo.semmni, | 288 | seminfo.semmni, |
| 289 | seminfo.semmsl, | 289 | seminfo.semmsl, |
| 290 | seminfo.semmns, seminfo.semopm, seminfo.semvmx); | 290 | seminfo.semmns, seminfo.semopm, seminfo.semvmx); |
| 291 | return; | 291 | return; |
| 292 | 292 | ||
| 293 | case STATUS: | 293 | case STATUS: |
| 294 | printf("------ Semaphore %s --------\n", "Status"); | 294 | printf("------ Semaphore %s --------\n", "Status"); |
| 295 | printf( "used arrays = %d\n" | 295 | printf("used arrays = %d\n" |
| 296 | "allocated semaphores = %d\n", | 296 | "allocated semaphores = %d\n", |
| 297 | seminfo.semusz, seminfo.semaem); | 297 | seminfo.semusz, seminfo.semaem); |
| 298 | return; | 298 | return; |
| 299 | 299 | ||
| 300 | case CREATOR: | 300 | case CREATOR: |
| 301 | printf("------ Semaphore %s --------\n", "Arrays Creators/Owners"); | 301 | printf("------ Semaphore %s --------\n", "Arrays Creators/Owners"); |
| 302 | printf( "%-10s %-10s %-10s %-10s %-10s %-10s\n", | 302 | printf("%-10s %-10s %-10s %-10s %-10s %-10s\n", |
| 303 | "semid", "perms", "cuid", "cgid", "uid", "gid"); | 303 | "semid", "perms", "cuid", "cgid", "uid", "gid"); |
| 304 | break; | 304 | break; |
| 305 | 305 | ||
| 306 | case TIME: | 306 | case TIME: |
| 307 | printf("------ Shared Memory %s --------\n", "Operation/Change Times"); | 307 | printf("------ Shared Memory %s --------\n", "Operation/Change Times"); |
| 308 | printf( "%-8s %-10s %-26.24s %-26.24s\n", | 308 | printf("%-8s %-10s %-26.24s %-26.24s\n", |
| 309 | "shmid", "owner", "last-op", "last-changed"); | 309 | "shmid", "owner", "last-op", "last-changed"); |
| 310 | break; | 310 | break; |
| 311 | 311 | ||
| 312 | case PID: | 312 | case PID: |
| @@ -314,8 +314,8 @@ static NOINLINE void do_sem(void) | |||
| 314 | 314 | ||
| 315 | default: | 315 | default: |
| 316 | printf("------ Semaphore %s --------\n", "Arrays"); | 316 | printf("------ Semaphore %s --------\n", "Arrays"); |
| 317 | printf( "%-10s %-10s %-10s %-10s %-10s\n", | 317 | printf("%-10s %-10s %-10s %-10s %-10s\n", |
| 318 | "key", "semid", "owner", "perms", "nsems"); | 318 | "key", "semid", "owner", "perms", "nsems"); |
| 319 | break; | 319 | break; |
| 320 | } | 320 | } |
| 321 | 321 | ||
| @@ -337,9 +337,9 @@ static NOINLINE void do_sem(void) | |||
| 337 | printf("%-8d %-10d", semid, ipcp->uid); | 337 | printf("%-8d %-10d", semid, ipcp->uid); |
| 338 | /* ctime uses static buffer: use separate calls */ | 338 | /* ctime uses static buffer: use separate calls */ |
| 339 | printf(" %-26.24s", semary.sem_otime | 339 | printf(" %-26.24s", semary.sem_otime |
| 340 | ? ctime(&semary.sem_otime) : "Not set"); | 340 | ? ctime(&semary.sem_otime) : "Not set"); |
| 341 | printf(" %-26.24s\n", semary.sem_ctime | 341 | printf(" %-26.24s\n", semary.sem_ctime |
| 342 | ? ctime(&semary.sem_ctime) : "Not set"); | 342 | ? ctime(&semary.sem_ctime) : "Not set"); |
| 343 | break; | 343 | break; |
| 344 | case PID: | 344 | case PID: |
| 345 | break; | 345 | break; |
| @@ -351,13 +351,13 @@ static NOINLINE void do_sem(void) | |||
| 351 | else | 351 | else |
| 352 | printf("%-10d %-9d", semid, ipcp->uid); | 352 | printf("%-10d %-9d", semid, ipcp->uid); |
| 353 | printf(" %-10o %-10ld\n", ipcp->mode & 0777, | 353 | printf(" %-10o %-10ld\n", ipcp->mode & 0777, |
| 354 | /* | 354 | /* |
| 355 | * glibc-2.1.3 and earlier has unsigned short; | 355 | * glibc-2.1.3 and earlier has unsigned short; |
| 356 | * glibc-2.1.91 has variation between | 356 | * glibc-2.1.91 has variation between |
| 357 | * unsigned short and unsigned long | 357 | * unsigned short and unsigned long |
| 358 | * Austin prescribes unsigned short. | 358 | * Austin prescribes unsigned short. |
| 359 | */ | 359 | */ |
| 360 | (long) semary.sem_nsems); | 360 | (long) semary.sem_nsems); |
| 361 | break; | 361 | break; |
| 362 | } | 362 | } |
| 363 | } | 363 | } |
| @@ -383,42 +383,42 @@ static NOINLINE void do_msg(void) | |||
| 383 | if ((msgctl(0, IPC_INFO, (struct msqid_ds *) (void *) &msginfo)) < 0) | 383 | if ((msgctl(0, IPC_INFO, (struct msqid_ds *) (void *) &msginfo)) < 0) |
| 384 | return; | 384 | return; |
| 385 | printf("------ Message%s --------\n", "s: Limits"); | 385 | printf("------ Message%s --------\n", "s: Limits"); |
| 386 | printf( "max queues system wide = %d\n" | 386 | printf("max queues system wide = %d\n" |
| 387 | "max size of message (bytes) = %d\n" | 387 | "max size of message (bytes) = %d\n" |
| 388 | "default max size of queue (bytes) = %d\n", | 388 | "default max size of queue (bytes) = %d\n", |
| 389 | msginfo.msgmni, msginfo.msgmax, msginfo.msgmnb); | 389 | msginfo.msgmni, msginfo.msgmax, msginfo.msgmnb); |
| 390 | return; | 390 | return; |
| 391 | 391 | ||
| 392 | case STATUS: | 392 | case STATUS: |
| 393 | printf("------ Message%s --------\n", "s: Status"); | 393 | printf("------ Message%s --------\n", "s: Status"); |
| 394 | printf( "allocated queues = %d\n" | 394 | printf("allocated queues = %d\n" |
| 395 | "used headers = %d\n" | 395 | "used headers = %d\n" |
| 396 | "used space = %d bytes\n", | 396 | "used space = %d bytes\n", |
| 397 | msginfo.msgpool, msginfo.msgmap, msginfo.msgtql); | 397 | msginfo.msgpool, msginfo.msgmap, msginfo.msgtql); |
| 398 | return; | 398 | return; |
| 399 | 399 | ||
| 400 | case CREATOR: | 400 | case CREATOR: |
| 401 | printf("------ Message%s --------\n", " Queues: Creators/Owners"); | 401 | printf("------ Message%s --------\n", " Queues: Creators/Owners"); |
| 402 | printf( "%-10s %-10s %-10s %-10s %-10s %-10s\n", | 402 | printf("%-10s %-10s %-10s %-10s %-10s %-10s\n", |
| 403 | "msqid", "perms", "cuid", "cgid", "uid", "gid"); | 403 | "msqid", "perms", "cuid", "cgid", "uid", "gid"); |
| 404 | break; | 404 | break; |
| 405 | 405 | ||
| 406 | case TIME: | 406 | case TIME: |
| 407 | printf("------ Message%s --------\n", " Queues Send/Recv/Change Times"); | 407 | printf("------ Message%s --------\n", " Queues Send/Recv/Change Times"); |
| 408 | printf( "%-8s %-10s %-20s %-20s %-20s\n", | 408 | printf("%-8s %-10s %-20s %-20s %-20s\n", |
| 409 | "msqid", "owner", "send", "recv", "change"); | 409 | "msqid", "owner", "send", "recv", "change"); |
| 410 | break; | 410 | break; |
| 411 | 411 | ||
| 412 | case PID: | 412 | case PID: |
| 413 | printf("------ Message%s --------\n", " Queues PIDs"); | 413 | printf("------ Message%s --------\n", " Queues PIDs"); |
| 414 | printf( "%-10s %-10s %-10s %-10s\n", | 414 | printf("%-10s %-10s %-10s %-10s\n", |
| 415 | "msqid", "owner", "lspid", "lrpid"); | 415 | "msqid", "owner", "lspid", "lrpid"); |
| 416 | break; | 416 | break; |
| 417 | 417 | ||
| 418 | default: | 418 | default: |
| 419 | printf("------ Message%s --------\n", " Queues"); | 419 | printf("------ Message%s --------\n", " Queues"); |
| 420 | printf( "%-10s %-10s %-10s %-10s %-12s %-12s\n", | 420 | printf("%-10s %-10s %-10s %-10s %-12s %-12s\n", |
| 421 | "key", "msqid", "owner", "perms", "used-bytes", "messages"); | 421 | "key", "msqid", "owner", "perms", "used-bytes", "messages"); |
| 422 | break; | 422 | break; |
| 423 | } | 423 | } |
| 424 | 424 | ||
| @@ -438,11 +438,11 @@ static NOINLINE void do_msg(void) | |||
| 438 | else | 438 | else |
| 439 | printf("%-8d %-10d", msqid, ipcp->uid); | 439 | printf("%-8d %-10d", msqid, ipcp->uid); |
| 440 | printf(" %-20.16s", msgque.msg_stime | 440 | printf(" %-20.16s", msgque.msg_stime |
| 441 | ? ctime(&msgque.msg_stime) + 4 : "Not set"); | 441 | ? ctime(&msgque.msg_stime) + 4 : "Not set"); |
| 442 | printf(" %-20.16s", msgque.msg_rtime | 442 | printf(" %-20.16s", msgque.msg_rtime |
| 443 | ? ctime(&msgque.msg_rtime) + 4 : "Not set"); | 443 | ? ctime(&msgque.msg_rtime) + 4 : "Not set"); |
| 444 | printf(" %-20.16s\n", msgque.msg_ctime | 444 | printf(" %-20.16s\n", msgque.msg_ctime |
| 445 | ? ctime(&msgque.msg_ctime) + 4 : "Not set"); | 445 | ? ctime(&msgque.msg_ctime) + 4 : "Not set"); |
| 446 | break; | 446 | break; |
| 447 | case PID: | 447 | case PID: |
| 448 | if (pw) | 448 | if (pw) |
| @@ -459,13 +459,13 @@ static NOINLINE void do_msg(void) | |||
| 459 | else | 459 | else |
| 460 | printf("%-10d %-10d", msqid, ipcp->uid); | 460 | printf("%-10d %-10d", msqid, ipcp->uid); |
| 461 | printf(" %-10o %-12ld %-12ld\n", ipcp->mode & 0777, | 461 | printf(" %-10o %-12ld %-12ld\n", ipcp->mode & 0777, |
| 462 | /* | 462 | /* |
| 463 | * glibc-2.1.3 and earlier has unsigned short; | 463 | * glibc-2.1.3 and earlier has unsigned short; |
| 464 | * glibc-2.1.91 has variation between | 464 | * glibc-2.1.91 has variation between |
| 465 | * unsigned short, unsigned long | 465 | * unsigned short, unsigned long |
| 466 | * Austin has msgqnum_t | 466 | * Austin has msgqnum_t |
| 467 | */ | 467 | */ |
| 468 | (long) msgque.msg_cbytes, (long) msgque.msg_qnum); | 468 | (long) msgque.msg_cbytes, (long) msgque.msg_qnum); |
| 469 | break; | 469 | break; |
| 470 | } | 470 | } |
| 471 | } | 471 | } |
| @@ -483,18 +483,18 @@ static void print_shm(int shmid) | |||
| 483 | } | 483 | } |
| 484 | 484 | ||
| 485 | printf("\nShared memory Segment shmid=%d\n" | 485 | printf("\nShared memory Segment shmid=%d\n" |
| 486 | "uid=%d\tgid=%d\tcuid=%d\tcgid=%d\n" | 486 | "uid=%d\tgid=%d\tcuid=%d\tcgid=%d\n" |
| 487 | "mode=%#o\taccess_perms=%#o\n" | 487 | "mode=%#o\taccess_perms=%#o\n" |
| 488 | "bytes=%ld\tlpid=%d\tcpid=%d\tnattch=%ld\n", | 488 | "bytes=%ld\tlpid=%d\tcpid=%d\tnattch=%ld\n", |
| 489 | shmid, | 489 | shmid, |
| 490 | ipcp->uid, ipcp->gid, ipcp->cuid, ipcp->cgid, | 490 | ipcp->uid, ipcp->gid, ipcp->cuid, ipcp->cgid, |
| 491 | ipcp->mode, ipcp->mode & 0777, | 491 | ipcp->mode, ipcp->mode & 0777, |
| 492 | (long) shmds.shm_segsz, shmds.shm_lpid, shmds.shm_cpid, | 492 | (long) shmds.shm_segsz, shmds.shm_lpid, shmds.shm_cpid, |
| 493 | (long) shmds.shm_nattch); | 493 | (long) shmds.shm_nattch); |
| 494 | printf("att_time=%-26.24s\n", | 494 | printf("att_time=%-26.24s\n", |
| 495 | shmds.shm_atime ? ctime(&shmds.shm_atime) : "Not set"); | 495 | shmds.shm_atime ? ctime(&shmds.shm_atime) : "Not set"); |
| 496 | printf("det_time=%-26.24s\n", | 496 | printf("det_time=%-26.24s\n", |
| 497 | shmds.shm_dtime ? ctime(&shmds.shm_dtime) : "Not set"); | 497 | shmds.shm_dtime ? ctime(&shmds.shm_dtime) : "Not set"); |
| 498 | printf("change_time=%-26.24s\n\n", ctime(&shmds.shm_ctime)); | 498 | printf("change_time=%-26.24s\n\n", ctime(&shmds.shm_ctime)); |
| 499 | } | 499 | } |
| 500 | 500 | ||
| @@ -510,24 +510,24 @@ static void print_msg(int msqid) | |||
| 510 | } | 510 | } |
| 511 | 511 | ||
| 512 | printf("\nMessage Queue msqid=%d\n" | 512 | printf("\nMessage Queue msqid=%d\n" |
| 513 | "uid=%d\tgid=%d\tcuid=%d\tcgid=%d\tmode=%#o\n" | 513 | "uid=%d\tgid=%d\tcuid=%d\tcgid=%d\tmode=%#o\n" |
| 514 | "cbytes=%ld\tqbytes=%ld\tqnum=%ld\tlspid=%d\tlrpid=%d\n", | 514 | "cbytes=%ld\tqbytes=%ld\tqnum=%ld\tlspid=%d\tlrpid=%d\n", |
| 515 | msqid, ipcp->uid, ipcp->gid, ipcp->cuid, ipcp->cgid, ipcp->mode, | 515 | msqid, ipcp->uid, ipcp->gid, ipcp->cuid, ipcp->cgid, ipcp->mode, |
| 516 | /* | 516 | /* |
| 517 | * glibc-2.1.3 and earlier has unsigned short; | 517 | * glibc-2.1.3 and earlier has unsigned short; |
| 518 | * glibc-2.1.91 has variation between | 518 | * glibc-2.1.91 has variation between |
| 519 | * unsigned short, unsigned long | 519 | * unsigned short, unsigned long |
| 520 | * Austin has msgqnum_t (for msg_qbytes) | 520 | * Austin has msgqnum_t (for msg_qbytes) |
| 521 | */ | 521 | */ |
| 522 | (long) buf.msg_cbytes, (long) buf.msg_qbytes, | 522 | (long) buf.msg_cbytes, (long) buf.msg_qbytes, |
| 523 | (long) buf.msg_qnum, buf.msg_lspid, buf.msg_lrpid); | 523 | (long) buf.msg_qnum, buf.msg_lspid, buf.msg_lrpid); |
| 524 | 524 | ||
| 525 | printf("send_time=%-26.24s\n", | 525 | printf("send_time=%-26.24s\n", |
| 526 | buf.msg_stime ? ctime(&buf.msg_stime) : "Not set"); | 526 | buf.msg_stime ? ctime(&buf.msg_stime) : "Not set"); |
| 527 | printf("rcv_time=%-26.24s\n", | 527 | printf("rcv_time=%-26.24s\n", |
| 528 | buf.msg_rtime ? ctime(&buf.msg_rtime) : "Not set"); | 528 | buf.msg_rtime ? ctime(&buf.msg_rtime) : "Not set"); |
| 529 | printf("change_time=%-26.24s\n\n", | 529 | printf("change_time=%-26.24s\n\n", |
| 530 | buf.msg_ctime ? ctime(&buf.msg_ctime) : "Not set"); | 530 | buf.msg_ctime ? ctime(&buf.msg_ctime) : "Not set"); |
| 531 | } | 531 | } |
| 532 | 532 | ||
| 533 | static void print_sem(int semid) | 533 | static void print_sem(int semid) |
| @@ -544,19 +544,19 @@ static void print_sem(int semid) | |||
| 544 | } | 544 | } |
| 545 | 545 | ||
| 546 | printf("\nSemaphore Array semid=%d\n" | 546 | printf("\nSemaphore Array semid=%d\n" |
| 547 | "uid=%d\t gid=%d\t cuid=%d\t cgid=%d\n" | 547 | "uid=%d\t gid=%d\t cuid=%d\t cgid=%d\n" |
| 548 | "mode=%#o, access_perms=%#o\n" | 548 | "mode=%#o, access_perms=%#o\n" |
| 549 | "nsems = %ld\n" | 549 | "nsems = %ld\n" |
| 550 | "otime = %-26.24s\n", | 550 | "otime = %-26.24s\n", |
| 551 | semid, | 551 | semid, |
| 552 | ipcp->uid, ipcp->gid, ipcp->cuid, ipcp->cgid, | 552 | ipcp->uid, ipcp->gid, ipcp->cuid, ipcp->cgid, |
| 553 | ipcp->mode, ipcp->mode & 0777, | 553 | ipcp->mode, ipcp->mode & 0777, |
| 554 | (long) semds.sem_nsems, | 554 | (long) semds.sem_nsems, |
| 555 | semds.sem_otime ? ctime(&semds.sem_otime) : "Not set"); | 555 | semds.sem_otime ? ctime(&semds.sem_otime) : "Not set"); |
| 556 | printf("ctime = %-26.24s\n" | 556 | printf("ctime = %-26.24s\n" |
| 557 | "%-10s %-10s %-10s %-10s %-10s\n", | 557 | "%-10s %-10s %-10s %-10s %-10s\n", |
| 558 | ctime(&semds.sem_ctime), | 558 | ctime(&semds.sem_ctime), |
| 559 | "semnum", "value", "ncount", "zcount", "pid"); | 559 | "semnum", "value", "ncount", "zcount", "pid"); |
| 560 | 560 | ||
| 561 | arg.val = 0; | 561 | arg.val = 0; |
| 562 | for (i = 0; i < semds.sem_nsems; i++) { | 562 | for (i = 0; i < semds.sem_nsems; i++) { |
