mmap: getting SIGBUS when writing to a position that is bellow what I requested
So!
I'm working with shared memory. I have requested mmap to get me shared memory of a given size to write onto: Code:
char * sharedMemory = mmap(0, memorySize, PROT_WRITE, MAP_SHARED, sharedMemFd, 0xf0000); Thanks in advance. |
Couple of things, we may try/check:
1) Change the 1st parameter to mmap() to NULL or any valid address. 2) Cross-check the value of 'memorySize'. |
The problem was the offset I was using: 0xf0000 (taken straight from the examples). I needed them to be in 0 and now it's working like a charm. Thanks for your kind help anyway.
|
All times are GMT -5. The time now is 09:44 PM. |