On Tue, 13 Apr 1999, Brian Beuning wrote:
> 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?
Machine from Hyatt has 512MB memory, from which i want to use 450megabyte
for hashtable.
This means that i must map it without using a file descriptor, or i can
only use 225 megabyte hash, as the other 225 the files gets mapped into
or something.
Currently i create at my own PII-450 dual with 128mb RAM files and
use them to mmap. The file must be at least as big as the hashtables.
Under NT and Unix i can do it without file descriptor, which makes my
hashtables 2 times bigger (i call that normal size then).
What i need is that MAP_ANON must be allowed to be combined with
MAP_SHARED, as one doesn't need a file descriptor then. Currently
this is not possible.
Is this gonna get implemented in linux kernel before june 1999,
or does someone know how to patch kernel for this?
> 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]