Unix Programming - mmap system call

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > August 2007 > mmap system call





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author mmap system call
Rakesh UV

2007-08-16, 1:22 am

Hi,
I am facing a situation where the mmap fails when two proccess
are trying to access a same shared memory allocated using mmap( the
memory is not private )

this code was working on true 64 but not working on HP-UX, please
provide some link or materials which deals with various
situation( some test code or tutorials) where
-> two proccess are access the same shared memory,
shared
-> two proccess are access the same shared memory,
private
-> the memory is taken from 32 bit addressable region
-> the mempry is mapped protected
etc etc all the possible combination
my code is quite bigger and the debugging becomes quite tough
i want check the situation with smaller code with similar purpose

Some tutorials or test code / some links providing the behaveiour of
mmap at various situation would be highly useful

Best Regards,
Rakesh UV

Gianni Mariani

2007-08-16, 7:20 am

Rakesh UV wrote:
> Hi,
> I am facing a situation where the mmap fails when two proccess
> are trying to access a same shared memory allocated using mmap( the
> memory is not private )


IIRC, I don't think HPUX supports mapping to different virtual
addresses. Could it be possible you're trying to do that ?
Scott Lurndal

2007-08-16, 1:23 pm

Rakesh UV <uvrakesh@gmail.com> writes:
>Hi,
> I am facing a situation where the mmap fails when two proccess
>are trying to access a same shared memory allocated using mmap( the
>memory is not private )


How does the mmap fail? Does it return an error code? If so, which
error code? Could you include the actual mmap call you are making?
Do you expect MAP_PRIVATE to allow two processes to see the same memory?
Do you specify the address in the process virtual address space on
the mmap call with MAP_FIXED?


scott
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com