Hagit
2004-01-28 09:51:34 UTC
I just cant get it!
I wrote a module that created its own entry in the /proc file system.
My module implemented read and write functions. When the user call
read(fd, &buff, 1) I am trying to copy to the user buff the character
B. When I use the
copy_to_user() function, the user doesnt get my B, but when I use the
sprintf() function the user gets the B. I cant understand it. what is
wrong???
The relevant calls are described below:
char raed_info = 'B';
copy_to_user(page, &read_info, sizeof(read_info));
sprintf(page,"%c",read_info);
Thanks
Hagit
I wrote a module that created its own entry in the /proc file system.
My module implemented read and write functions. When the user call
read(fd, &buff, 1) I am trying to copy to the user buff the character
B. When I use the
copy_to_user() function, the user doesnt get my B, but when I use the
sprintf() function the user gets the B. I cant understand it. what is
wrong???
The relevant calls are described below:
char raed_info = 'B';
copy_to_user(page, &read_info, sizeof(read_info));
sprintf(page,"%c",read_info);
Thanks
Hagit