LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-24-2007, 12:59 AM   #1
phoenix_dame
LQ Newbie
 
Registered: Apr 2007
Location: Asia
Posts: 2

Rep: Reputation: 0
IPC resource clean up


Hi,
I have to clean up the ipc resources allocated to specific programs in my program.
The only information I have regarding any particular process is its process id.
I am using kill(pid,SIGTERM); to kill the process. But this does not clean up the allocated ipc resources.
Is there any other way? I cannot use shmctl etc... since i don't have access to msqid, semid and shmid of the resources allocated to the processes. Moreover, I do not want to clean up all the resources for all programs (for which i have a script). It has to be specific to a particular program, given its process id.

Thanks.
 
Old 04-24-2007, 01:47 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
From a shell, you can use ipcrm if you are sufficiently privileged. Also, ipcs can be used to view the state of IPC entities. Programmatically, I think you can acquire the information provided by ipcs from the /proc/sysvipc filesystem, and from there, with sufficient privilege, you can use shmctl() and friends.

--- rod.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need some resources about IPC gauge73 Linux - Newbie 6 11-17-2006 09:46 AM
what is the best design(ipc) harvest Programming 2 10-03-2006 04:22 PM
IPC question... climbingmerlin Programming 4 11-03-2005 03:30 AM
about IPC iclinux Programming 1 01-14-2005 11:16 PM
Semaphores and IPC gsu_790 Programming 2 09-29-2004 09:29 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration