Re: How to read file in kernel module?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Whoops! I'm sorry, I did not see Amit's post above, it has pretty much
the same kind of code in my post. More elaborate, though.


On Wed, 2 Feb 2005 15:02:51 +0530, Karthik Subramanian
<karthik301176@xxxxxxxxx> wrote:
> >> See i think we are talking about kernel programming . What i mean to
> >> say is
> >> that there is only two ways to  communiacte to user space . One through
> >> a
> >> registerd read or write functions
> 
> Well, for what it's worth - I have tried to write to a file from the
> kernel this way, and succeeded:
> 
> --- <snip> ---
> 
> fd = sys_open(filename, O_SYNC|O_APPEND, 0);
> sys_write(fd, msg, msglen);
> sys_close(fd);
> 
> --- <snip> ---
> 
> From all the discussions about writing to / reading from files
> directly from the kernel, I'm sure this is a dirty thing to do. Could
> someone please shed some light on *why* it is bad to write to files
> directly from the kernel?
> 
> Thanks,
> K.
> 
> --
> There are things known and things unknown, in between lie the Doors
> 


-- 
There are things known and things unknown, in between lie the Doors

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux