[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: puzzle about open in kernel
It's in usermode, so sys_open() is not available, here we have to use open.
Coywolf
----- Original Message -----
From: "madsys" <admin@ercist.iscas.ac.cn>
To: <kernelnewbies@nl.linux.org>
Sent: Friday, December 05, 2003 3:17 PM
Subject: puzzle about open in kernel
> hi all,
>
> I have a puzzle about open() in kernel lately.
>
> see below please:
>
> init/main.c [init()]:
> ---snip---
> if (open("/dev/console", O_RDWR, 0) < 0)
> printk("Warning: unable to open an initial console.\n");
> ---snip---
>
> I know that open() is a wrapper of system call. But who can tell me
why the kernel use system call "open" instead of the direct sys_open
function in the kernel? Can we change it to the sys_open function here?
>
>
> thanx in advanced!
> madsys
>
>
>
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive: http://mail.nl.linux.org/kernelnewbies/
> FAQ: http://kernelnewbies.org/faq/
>
>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/