On 04/06/07, Pravin <shindepravin@xxxxxxxxx> wrote:
Hi, I need to open a text-file from kernel itself, and read the contents from that file, and close that file. I tried using sys_open system call, but I was getting error saying "bad address" After playing around for some time, I felt that this system calls assume that all data sent to them is from userspace, and even the output that they will be giving should go to userspace. One more problem is that, this "sys_open" and "sys_read" system call use file-discripter which is stored in tast_struct of current process. I would also like to avoid this. Is there any way by which I can read the contents of the file from the kernel itself ? Are there any example in kernel, which will help me in understanding how to read from textfile.
I think you'll find that this article answers all your questions : http://kernelnewbies.org/FAQ/WhyWritingFilesFromKernelIsBad -- Jesper Juhl <jesper.juhl@xxxxxxxxx> Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html Plain text mails only, please http://www.expita.com/nomime.html -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ