Re: mmap operation not working as expected on sparc linux

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

 



> http://en.wikipedia.org/wiki/Ring_buffer#Exemplary_POSIX_Implementation
>
> This doesn't appear to work on sparclinux, returning an error EINVAL  on
> the second memory map operation:
>
> address = mmap (buffer->address + buffer->count_bytes,
>                   buffer->count_bytes, PROT_READ | PROT_WRITE,
>                   MAP_FIXED | MAP_SHARED, file_descriptor, 0);
>
> Any ideas?

Steven the problem are on the second mmap, this is the third call to mmap...


First call:
buffer->address = mmap (NULL, buffer->count_bytes << 1, PROT_NONE,
                          MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);

Second call (where the problem occurs, returns 0xffffffff):
address =    mmap (buffer->address, buffer->count_bytes, PROT_READ | PROT_WRITE,
          MAP_FIXED | MAP_SHARED, file_descriptor, 0);

Third (is not called because the error of the second) :
 address = mmap (buffer->address + buffer->count_bytes,
                  buffer->count_bytes, PROT_READ | PROT_WRITE,
                  MAP_FIXED | MAP_SHARED, file_descriptor, 0);


Some ideas ? What can be the reason of this behavior ?


-- 
William Felipe Welter
------------------------------
Consultor em Tecnologias Livres
william.welter@xxxxxxxxxxxxx
www.4linux.com.br
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux