The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
parent not waiting until child complete executing another program through execl() vvaidyan High Level Programming 4 05-16-2008 03:00 AM
Parent child Relation !! using awk/sed ??? varungupta UNIX for Advanced & Expert Users 0 01-29-2008 10:24 AM
kill parent and child larry UNIX for Dummies Questions & Answers 4 01-11-2003 08:18 PM
How hard can it be? ps child/parent velde046 Filesystems, Disks and Memory 2 05-25-2002 01:36 PM
what are parent and child processes all about? xyyz UNIX for Dummies Questions & Answers 1 04-26-2002 12:53 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-17-2007
Registered User
 

Join Date: Jan 2007
Posts: 30
Stumble this Post!
shared memory between parent and child, when execl()

Hi,

Am new to Linux internals.
I want to use shared memory segment between the parent and the child processess.
if i create a shared memory before fork,the child inherits the attached
shared memory segments but once i call exec in the child process, all attached shared memory segments are detached. How to maintain a shared memory segment between parent and child even if i call exec in the child processess.

Thanks in advance..
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 01-17-2007
elzalem's Avatar
Registered User
 

Join Date: Nov 2006
Location: Lebanon
Posts: 33
Stumble this Post!
exec

The exec() family of system calls is a group of six calls that are used to overlay the process image of a process with the code and data of a new process copied from a file. http://www.scit.wlv.ac.uk/~jphb/spos...alls/exec.html

in other words, everything that used to be in the memory of the caller process such as variables... will be thrown away. u should re attach the shared memory from the called program.
HINT: send the shared memory ID or key to the new called process as arguments from the exec function
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:12 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0