From: Tommy Reynolds <Tommy.Reynolds@MegaCoder.com>
To: linux-kernel@vger.kernel.org
Subject: Re: question about execve()
Date: Mon, 11 Apr 2005 03:28:06 -0500 [thread overview]
Message-ID: <20050411032806.276493ce.Tommy.Reynolds@MegaCoder.com> (raw)
In-Reply-To: <425A1F32.4020809@haha.com>
[-- 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 --]
prev parent reply other threads:[~2005-04-11 8:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-11 6:54 question about execve() Tomko
2005-04-11 8:28 ` Tommy Reynolds [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050411032806.276493ce.Tommy.Reynolds@MegaCoder.com \
--to=tommy.reynolds@megacoder.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox