mmap problem
hi
i created a programme who use a library. the library talk to a driver. the library need to write in shared memory between the application and kernel. i try to use mmap. in my application, i do: Code:
static const int _MAXMSGSIZE = 256; Code:
*addr1 = "a"; any idea? |
I don't know if this will solve your problem, but you're trying to assign a string to a character.
*addr1 is the location of a single character in memory. "a" is a string (not a single character; use single quotes to specify a character) Try: Code:
*addr1 = 'a'; |
when u say 'the machine freezes', do u mean the entire machine hangs and u have to reboot?? if so, can u plz tell me what device it is you are trying to open?
|
no not need to reboot... i can kill the application
i got the same problem, Dark_Helmet with your solution |
you are only specifying PROT_READ, and u r trying to write to the memory.
|
All times are GMT -5. The time now is 11:26 AM. |