problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi:
I have a LKM with a /proc file to communicate a user land process with. 
this is the read function in my LKM:
_____________________________________
copy_to_user(buf, strBuf, len);
put_user(0, &buf[len]);
...
return len

and this is what i do in the userland:

int fd = open("/proc/my_proc", O_RDONLY);
char *res;
read(fd, res, 20);
close(fd);
_____________________________________
it can read ok, but i get the following messages:

01913: symbol=exit;  lookup in file=/home/..././savld /*This is my user 
land proc*/
01913: symbol=exit;  lookup in file=/usr/lib/libstdc++-libc6.2-2.so.3
...
lookup 0x080048000 0x00000238 -> 0x40092000 0x000e04f0 /1 close
01913: symbol=exit;  lookup in file=/home/..././savld /*This is my user 
land proc*/
01913: symbol=exit;  lookup in file=/usr/lib/libstdc++-libc6.2-2.so.3
...
Segmentation Fault

can somebody tell what's wrong?

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux