exec() system call | Unix Linux Forums | Programming

  Go Back    


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

exec() system call

Programming


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 02-02-2004
a25khan's Avatar
a25khan a25khan is offline
Registered User
 
Join Date: Dec 2003
Last Activity: 2 March 2004, 11:56 PM EST
Location: My home :D
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
exec() system call

hi there,
i was reading about the exec() function. and if i m not wrong, exec() kills your present process and starts a new process in its place. the process id remains the same.
then it says if exec is successful the text data and stack are overlayed by new file! -
i dont get this part "only user area is maintained across exec system call"
can someone tell me what the user area is in particular? like what part of a program would be user area!?
Thank You!
Sponsored Links
    #2  
Old 02-02-2004
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 30 September 2014, 8:56 PM EDT
Location: Ashburn, Virginia
Posts: 9,930
Thanks: 64
Thanked 436 Times in 261 Posts
No part of the program is in the user area. Exactly what is there varies from one version of unix to the next. But some possible examples:

process start time
controlling terminal of process
current directory of the process
size of the stack
size of the data segment
uid of the process

In short its a bunch of stuff that the kernel needs to manage the process. But the kernel stores it in the process to keep the kernel small. This made sense when computers had 16 bit addresses. It makes less sense these days with 32 or even 64 bit addresses. Some kernels are moving a lot of stuff out of the uarea and into the proc table.

If you poke around /usr/include, you may find user.h which will show exactly what's in your uarea.
Sponsored Links
    #3  
Old 02-02-2004
a25khan's Avatar
a25khan a25khan is offline
Registered User
 
Join Date: Dec 2003
Last Activity: 2 March 2004, 11:56 PM EST
Location: My home :D
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
MySQL

Perderabo,
thanks for the answer. i tried looking in /usr/include for user.h or something similar but it wasn't there. ne way i won't confuse myself at this stage for that. your answer was sufficient and i'll shut up now
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
[C] exec system call lamachejo Programming 3 12-12-2011 08:30 PM
How to run two commands from a exec call in a c program suryashikha UNIX for Dummies Questions & Answers 3 10-30-2009 08:11 AM
Perl variables in exec or system ahmed_zaher Shell Programming and Scripting 8 08-16-2009 04:20 PM
exec to call specific function in C prog vpraveen84 UNIX for Advanced & Expert Users 2 06-03-2008 02:55 PM
how to differentiate system call from library call muru UNIX for Advanced & Expert Users 2 07-19-2007 11:20 PM



All times are GMT -4. The time now is 08:13 AM.