Looking at the kernel (2.0.35) source code, it looks like MAP_SHARED
requires a file descriptor. Or put the other way, having no file descriptor
requires MAP_PRIVATE.
If you think about it a minute, not having a file descriptor either means you
need to have 450 MB of swap space for the memory -or- the mmap region is
locked in memory. Do you have more than 450 MB of physical memory?
Brian Beuning
Vincent Diepeveen wrote:
> Hello,
>
> I tried to add to the list, but no confirmation yet, so i
> guess my subscription failed. Please CC me too if you answer this message.
>
> My problem is next:
>
> shmptr =
> mmap(0, /* system assigns address */
> 450000000, /* size of shared memory segment */
> (PROT_READ | PROT_WRITE), /* access rights, can be rwx */
> (MAP_ANON | MAP_SHARED), /* anonymous, shared */
> 0, /* file descriptor (not used) */
> 0); /* file offset (not used) */
>
> I get error:
> : Invalid argument.
>
> MAP_ANON|MAP_SHARED is not supported by that kernel 2.0.something that is
> in redhat 5.1
>
> I wonder whether new kernels > 2.2.x support this
> MMAP option, because i can allocate 2 times more memory then than i do
> now, and don't need to swap that whole file into memory then.
>
> Note that the shmget function doesn't work either for me.
>
> This function supports maximum of 4 megabytes shared memory,
> which is around 100 times less than i need.
>
> Greetings,
> Vincent Diepeveen.
>
> -
> Linux SMP list: FIRST see FAQ at http://www.irisa.fr/prive/mentre/smp-faq/
> To Unsubscribe: send "unsubscribe linux-smp" to [EMAIL PROTECTED]
-
Linux SMP list: FIRST see FAQ at http://www.irisa.fr/prive/mentre/smp-faq/
To Unsubscribe: send "unsubscribe linux-smp" to [EMAIL PROTECTED]