All of lore.kernel.org
 help / color / mirror / Atom feed
* About system calls question...
@ 2001-07-23  6:32 machael thailer
  0 siblings, 0 replies; only message in thread
From: machael thailer @ 2001-07-23  6:32 UTC (permalink / raw)
  To: linuxppc-embedded


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/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-07-23  6:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-23  6:32 About system calls question machael thailer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.