Hi !
I guess u need to read user space from kernel sapce.
You can use the sys_call_table functions for this.
For example, u can use the following code in your file to open a user space
file from kernel space.
#define BEGIN_KMEM {mm_segment_t old_fs=get_fs();set_fs(get_ds());
#define END_KMEM set_fs(old_fs);}
int (*sample_open)(char *, int);
sample_open = sys_call_table[SYS_open];
BEGIN_KMEM
sample_open("/home/samplefile.txt",O_RDWR);
/* the same way close , read , write etc. can be written */
END_KMEM
Regards,
Vinolin.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/