I tried using copy_to_user()
inside a loop.
for_each_process(p) {
copy_to_user(buf, "data of p", len);
}
But, the output that I got is different. It has only the last line of data in the user space, e.g.
#Data expected to copy to user space
123 1234 12 21
1243 124 423 12
1234 422 42 423
#Current Output:
1234 422 42 423
How to copy each line to the user space from the kernel space?