lkml.org 
[lkml]   [2005]   [Apr]   [11]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateMon, 11 Apr 2005 03:28:06 -0500
FromTommy Reynolds <>
SubjectRe: question about execve()
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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-04-11 08:41    [W:0.107 / U:0.160 seconds]
©2003-2008 Jasper Spaans