Re: [mpls-linux-general] writting into proc file
Status: Beta
Brought to you by:
jleu
From: Abhijit G. <gab...@ee...> - 2002-01-04 15:18:09
|
Look for documentation of sysctl interface. It essentially does that.. But better use netlink if u want to pass data between userspace n kernelspace. As far as i know sysctl interface has few limitations. -abhijit vvk...@hs... wrote : > > >Hi Folks ! > Can anybody explain how will be the mechanism to write into file > in the /proc filesystem from kernel space ........... > > In the 2.4.x linux kernel , for less than PAGE_SIZE data transfer , >i am using the following mechanism to register the entry in the /PROC >filesytem... > > struct proc_dir_entry *entry=create_proc_entry("xyz", S_IRUGO | S_IWUGO , >NULL ); > > if ( entry ) > { > entry->read_proc = xyz_read_proc; > entry->write_proc = xyz_write_proc; > } > >are these mean to say that accessing this file from userspace........or kernel >space.......... > >Is this mean to say that , when user invokes "read" or "write" system directly >or indirectly with ANSI library > >will be available for user to access this file ? > >I want to write the content into a file ..i.e in /proc .... from kernel >space......... > >What will be various options to acheive this ? > >can anybody send a small template for this , will be greatly >appreciated.......... > >Thanks in advance......... > >With thanx and regards, >Ramakrishna kvv. |