| From | Sent On | Attachments |
|---|---|---|
| ravi | Jul 19, 2004 4:58 am | |
| Robert Watson | Jul 20, 2004 7:49 pm | |
| ravi | Jul 20, 2004 9:36 pm | |
| ravi | Jul 20, 2004 11:08 pm | |
| ravi | Aug 3, 2004 2:46 am | |
| Robert Watson | Aug 3, 2004 8:07 am | |
| ravi | Aug 3, 2004 9:01 pm | |
| Dan Nelson | Aug 3, 2004 10:01 pm | |
| ravi | Aug 3, 2004 11:45 pm | |
| ravi | Aug 3, 2004 11:52 pm | |
| ravi | Aug 5, 2004 12:25 am |
| Subject: | Regarding writing to /proc entries | |
|---|---|---|
| From: | ravi (ravi...@ap.sony.com) | |
| Date: | Aug 5, 2004 12:25:30 am | |
| List: | org.freebsd.freebsd-fs | |
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





