linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* question about execve()
@ 2005-04-11  6:54 Tomko
  2005-04-11  8:28 ` Tommy Reynolds
  0 siblings, 1 reply; 2+ messages in thread
From: Tomko @ 2005-04-11  6:54 UTC (permalink / raw)
  To: linux kernel mailing list

Hi,

I would like to ask when a userprogram called in user space called 
execve("/bin/abc"....   will  this system call finally copy the code of 
/bin/abc into kernel space before kernel runs it or just leave the code 
in the userspace and run directly ?  If the system really copy the 
program into kernel space , why ?
Hope some one can tell me

Regards,
TOM

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: question about execve()
  2005-04-11  6:54 question about execve() Tomko
@ 2005-04-11  8:28 ` Tommy Reynolds
  0 siblings, 0 replies; 2+ messages in thread
From: Tommy Reynolds @ 2005-04-11  8:28 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 702 bytes --]

Uttered Tomko <tomko@haha.com>, spake thus:

> I would like to ask when a userprogram called in user space called 
> execve("/bin/abc"....   will  this system call finally copy the code of 
> /bin/abc into kernel space before kernel runs it or just leave the code 
> in the userspace and run directly ? 

None of these.  All "execve" really does is to discard the current VM
setup, tell the VM system to attach this process to the new
executable image, and then transfer control to the starting
instruction of the program.  Since nothing is really in memory, aside
from maybe some caching/readahead, page faults do all the work of
loading application code, page by page, on demand.

HTH

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-04-11  8:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-11  6:54 question about execve() Tomko
2005-04-11  8:28 ` Tommy Reynolds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).