Re: Opening files in kernel mode

From: Igmar Palsenberg (maillist@chello.nl)
Date: Mon Jun 12 2000 - 07:44:34 EST


On Fri, 2 Jun 2000, S.Venkat Raman wrote:

> Hi,
> Does anyone know if there is a function to
> open ( and read )a file when working in kernel
> mode. Like for example there is a kernel
> equivalent of printf ( printk ) and malloc (kmalloc).
> Open is not there in <linux/fcntl.h> i am
> also looking for kernel version of read too
> which is also not there in <linux/unistd.h>.
>
> if i try and use <fcntl.h> and <unistd.h> there
> are some conflicts with the other files that
> i include as a result it doesnt compile.
>
> i am need the functions as part of a device driver
> in which i need to open a file and copy the
> contents into the device.

Use ioctl calls from usermode for this purpose. Reading config files from
the kernel is in most cases a bad idea.
 
> Please CC a reply to me incase you have some
> solution to this problem.
>
> thanks in advance,
> venkat

        Regards,

                Igmar

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 21:00:25 EST