From: "machael thailer" <dony.he@huawei.com>
To: <linuxppc-embedded@lists.linuxppc.org>
Subject: About system calls question...
Date: Mon, 23 Jul 2001 14:32:36 +0800 [thread overview]
Message-ID: <004701c11341$43e704a0$8021690a@huawei.com> (raw)
I have a question about how to use system calls...
I notice that in init/main.c=>init() functions:
init(void * unused)
{
....
if (open("/dev/console", O_RDWR, 0) < 0)
printk("Warning: unable to open an initial console.\n");
(void) dup(0);
(void) dup(0);
/*
* We try each of these until one succeeds.
*
* The Bourne shell can be used instead of init if we are
* trying to recover a really broken machine.
*/
if (execute_command)
execve(execute_command,argv_init,envp_init);
execve("/sbin/init",argv_init,envp_init);
......
}
My question is since "open" "dup" and "execve" are system calls, they should
be called only in user process instead of in kernel space.
Why can they be used in this way here?
Thanks in advance!
machael thailer
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
reply other threads:[~2001-07-23 6:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='004701c11341$43e704a0$8021690a@huawei.com' \
--to=dony.he@huawei.com \
--cc=linuxppc-embedded@lists.linuxppc.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;
as well as URLs for NNTP newsgroup(s).