SYS V IPC, how does "ipcs" get list of existing IPC structures

SYS V IPC, how does "ipcs" get list of existing IPC structures

Post by Glenn Farr » Wed, 04 Sep 1996 04:00:00



I need to clean up after a process which tends to die leaving IPC structures
* about.  Currently I use "system" to run
"ipcs | grep $USERNAME | cut | ipcrm" to clean up the IPC structures for the
user.  What is the mechanism for obtaining all IPC structures for a given user
programatically?  (i.e.) How can I get a list of all message structures
created by a specific user so that I can delete them using "msgctl", "semctl",
etc.

                                                Glenn

 
 
 

SYS V IPC, how does "ipcs" get list of existing IPC structures

Post by W. Richard Steve » Wed, 04 Sep 1996 04:00:00


Quote:> I need to clean up after a process which tends to die leaving IPC structures
>* about.  Currently I use "system" to run
> "ipcs | grep $USERNAME | cut | ipcrm" to clean up the IPC structures for the
> user.  What is the mechanism for obtaining all IPC structures for a given user
> programatically?  (i.e.) How can I get a list of all message structures
> created by a specific user so that I can delete them using "msgctl", "semctl",
> etc.

It's been a long time since I've seen System V sources, but as I recall,
ipcs grovels through /dev/kmem looking at the internal kernel data
structures for these items.

        Rich Stevens

 
 
 

1. A List of "GOOD" books on IPC, Thank you!

Fri Mar 20 18:44:48 EST 1987

Hello Net People:

     Thank  you  for  all  your help in my quest for a "GOOD" book on IPC!  It
seems that the number one choice is Marc Rochind's "Advanced UNIX Programming"
(Prentice Hall, ISBN 0-13-011800-1).  Some other suggestions where:

                         AT&T UNIX System V Release 3
                              Programmer's guide
                         chapter 9 (about 100 pages)

                               Programing in C
                             by Stephen G. Kocha
                            The Net Person stated
                          "is a good beginners book,
              though it doesn't address PC specific problems."

                          Internetworking with XINU
                            by Doug Comer Prentice
                           Hall ISBN-0-13-637414-X

     I have not read any of these books YET.  Therefore, I am not able to give
a  review  on them.  Since I am still receiving request I thought I would post
this.

   _______
   |     |                      James D. Corder
   |UNIX!|                      P.O. Box 27473
  ---------                     Columbus, Ohio 43227
   \~. .~/
   (  *  )                      ...cbatt!osupyr!Alix!corder
----| O |----
    \ v /
 --- \ / ---
      V                         Your comments may someday become part of a book!        

2. Can not load iBCS modules ?

3. Getting a copy of "4.3BSD IPC Tutorials"

4. zsh 2.5?

5. GETSERVBYNAME()????????????????????"""""""""""""

6. Jerky mouse cursor under Solaris 2.5

7. """"""""My SoundBlast 16 pnp isn't up yet""""""""""""

8. Password Checker For SVR[34]??

9. "System V IPC is a botch?"

10. What is "type" and "structure"

11. How can I change "kern.ipc.maxsockets"?

12. what means "IPC$" as share in SAMBA?

13. System function "select( )" and IPC Message Queue