Subject: bin/455: ipcs reports shm segments and semaphores as 'q's
To: None <gnats-admin>
From: Arne H Juul <arnej@dsl.unit.no>
List: netbsd-bugs
Date: 09/02/1994 14:20:03
>Number:         455
>Category:       bin
>Synopsis:       Just a cut-and-paste typo, I guess.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep  2 14:20:02 1994
>Originator:     Arne H Juul
>Organization:
University of Trondheim, Norway
>Release:        
>Environment:
	Netbsd-current as of yesterday
System: NetBSD skarven.dsl.unit.no 1.0_BETA NetBSD 1.0_BETA (SKARVEN) #2: Sun Jul 31 16:32:24 MET DST 1994 arnej@skarven.dsl.unit.no:/usr/src/sys/arch/i386/compile/SKARVEN i386


>Description:
	I had a script that used ipcs output to delete specific
	semaphores and shared memory. It still won't work because
	output format differs, but now I can write my own script
	more easily :-)
>How-To-Repeat:
	run some program that allocates semaphores and shared memory,
	then run ipcs and watch the output.
>Fix:
	Apply this patch:
diff -rcP /usr/src/usr.bin/ipcs/ipcs.c ./usr.bin/ipcs/ipcs.c
*** /usr/src/usr.bin/ipcs/ipcs.c	Tue Jun 21 12:26:33 1994
--- ./usr.bin/ipcs/ipcs.c	Thu Sep  1 08:04:26 1994
***************
*** 332,338 ****
  					cvt_time(shmptr->shm_dtime, dtime_buf);
  					cvt_time(shmptr->shm_ctime, ctime_buf);
  
! 					printf("q %6d %10d %s %8s %8s",
  					    IXSEQ_TO_IPCID(i, shmptr->shm_perm),
  					    shmptr->shm_perm.key,
  					    fmt_perm(shmptr->shm_perm.mode),
--- 332,338 ----
  					cvt_time(shmptr->shm_dtime, dtime_buf);
  					cvt_time(shmptr->shm_ctime, ctime_buf);
  
! 					printf("m %6d %10d %s %8s %8s",
  					    IXSEQ_TO_IPCID(i, shmptr->shm_perm),
  					    shmptr->shm_perm.key,
  					    fmt_perm(shmptr->shm_perm.mode),
***************
*** 429,435 ****
  					cvt_time(semaptr->sem_otime, otime_buf);
  					cvt_time(semaptr->sem_ctime, ctime_buf);
  
! 					printf("q %6d %10d %s %8s %8s",
  					    IXSEQ_TO_IPCID(i, semaptr->sem_perm),
  					    semaptr->sem_perm.key,
  					    fmt_perm(semaptr->sem_perm.mode),
--- 429,435 ----
  					cvt_time(semaptr->sem_otime, otime_buf);
  					cvt_time(semaptr->sem_ctime, ctime_buf);
  
! 					printf("s %6d %10d %s %8s %8s",
  					    IXSEQ_TO_IPCID(i, semaptr->sem_perm),
  					    semaptr->sem_perm.key,
  					    fmt_perm(semaptr->sem_perm.mode),
>Audit-Trail:
>Unformatted:


------------------------------------------------------------------------------