> If you are accessing /proc/spoon with user program > thats executed as root then theres no problem to write > /proc entries. I already did that and able to write to > /proc entry. > > > If no one can write to /proc how is it used for > > communication between > > kernel mode and user mode? > > /proc is virtual filesystem that stores kernel > internal states in various files under /proc dir. > You are confusing with /proc system. Kernel > writes to /proc entries via > typedef int (get_info_t)(char *, char **, off_t, int); > interface provided by proc_fs.h check > /usr/src/linux-2.4/include/linux/proc_fs.h > > how user mode communicates kernel=> by using say > cat /proc/net/route to print kernel IP routing table > > > And all the code that I am trying out is being > > executed as root. Yet > > it does not work. > > In fact I even tried to open the file /proc/spoon > > (as root )using vi. > > It opens, but does not allow me to write to it. > > > > -Shri > Hope this helps you to understand /proc
Thanks a million linux_lover :) . Thats as comprehensive as one could get. But i guess, I have a long way to go for understanding /proc. This post is just to clarify some points. In my case both the kernel mode routine (which creates the /proc entry) and the user mode process (which has to read/write to the /proc entry) are mine. I had not registered the handlers for the read and write calls for the /proc entry. Although I have not tried it practically yet, I guess registering them would do the trick. When a process gives a call to write to the /proc entry, the read routine registered with the kernel is called. Similarly when a process gives a call to read the /proc entry, the write routine regiestered for that /proc entry is called. As these routines have not been registered, the calls will definitely not go ahead. Will definitely try that asap and will keep the group posted about the progress. Thanks -Shri -- ______________________________________________________________________ Pune GNU/Linux Users Group Mailing List: ([email protected]) List Information: http://plug.org.in/mailing-list/listinfo/plug-mail Send 'help' to [EMAIL PROTECTED] for mailing instructions.
