Re: RE: Re: Device driver query

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

 



  
Hi,


>Proc files are dynamic files, their data is not stored on HDD, there
>contents are generated by kernel when they are open or read, actually
>they are the medium for processes to communicate with kernel (to read
>the kernel specific data or set the kernel specific parameters) 

This is true....but incomplete. 

You can also write into a proc file as long as the implementation of the particular proc file provides a write functionality.

For ex: Setting some debugging level masks for /proc/scsi to get debug messages. You would need to write into the particular /proc file for that!

You can indeed do this from user land.

Hope this helps.

Thanks,
Vinod


>you should not use them as normal files.
>
>
>
>Can you tell me what exactly you want to do, if you want normal file
>behavior, what's the problem in using a normal file which is maintained
>by file system.
>
>
>
>Regards,
>
>Gaurav
>
>
>
>   _____
>
> From: kernelnewbies-bounce@xxxxxxxxxxxx
>[mailto:kernelnewbies-bounce@xxxxxxxxxxxx] On Behalf Of linux lover
>Sent: Tuesday, September 14, 2004 12:23 PM
>To: Shakthi Kannan
>Cc: kernelnewbies
>Subject: Re: Re: Device driver query
>
>
>
>Hello Shakthi,
>
>             But does it allow me to add or delete contents in file like
>as usual normal file(I KNOW U SAID PROC FILE). What i want to update
>contents of file periodically from user programs? Does /proc allows to
>do that thing to me???
>
>regards,
>
>linux_lover.
>
>
>
>On Mon, 13 Sep 2004 Shakthi Kannan wrote :
> >Hi!
> >
> > > > You said that you want to create a file at loading
> > > > time and want to
> > > > remove that file forom file system at unloading
> > > > time
> >
> >Why not use the /proc filesystem for this? It is quite simple.
> >
> >Example:
> >
> >int scull_read_procmem (char *buf, char **start, off_t offset, int
> >count, int *eof, void *data) {
> >  int len = 0;
> >  len += sprintf (buf+len, "\nFrom scull_read_procmem");
> >  return len;
> >}
> >
> >static void scull_create_proc() {
> >  create_proc_read_entry ("scullmem",
> >      0,
> >      NULL,
> >      scull_read_procmem,
> >       NULL);
> >}
> >
> >Regards,
> >
> >Shaks
> >
> >--
> >Kernelnewbies: Help each other learn about the Linux kernel.
> >Archive:       http://mail.nl.linux.org/kernelnewbies/
> >FAQ:           http://kernelnewbies.org/faq/
> >
>
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam? Yahoo! Mail has the best spam protection around
>http://mail.yahoo.com
>

[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