Regarding writing to /proc entries
    ravi 
    ravi.nanjundappa at ap.sony.com
       
    Thu Aug  5 00:25:50 PDT 2004
    
    
  
Hi,
I've created my own /proc entries using linprocfs.c with read and write
permissions like this
" pfs_create_file(root,"EXAMPLE",&myfunc,NULL,NULL,PFS_RDWR); "
and I've associated my own filler function as follows .
static int myfunc(PFS_FILL_ARGS)
{
	printf(" in myfunc() .....\n");
	if(uio->uio_rw ==UIO_WRITE)
		printf(" write request \n");
	else
		printf(" read request \n");
	sbuf_printf(sb, " myfunc function called\n");
	printf(" exiting from myfunc() .....\n");
	return 0;
}
Please read the above statements .
When I run "cat /proc/EXAMPLE" I'll get the follwing o/p on the screen .
OUTPUT:
in myfunc() .....
read request
exiting from myfunc() .....
myfunc function called
in myfunc() .....
read request
exiting from myfunc() .....
Even though I'm checking the operation that is requested with the
conditional statements if (uio->uiorw==UIO_WRITE) and when I run 
"echo 0 > /proc/EXAMPLE " I'm getting the following error 
ERROR:
	/proc/EXAMPLE : Operation not supported
The same error is coming even for process related " ctl " files as well
when I run 
"echo attach /proc/12/ctl " 
Please tell me the reason and solution for this .
Regards,
N Ravi
    
    
More information about the freebsd-fs
mailing list