From: unrza3@cd4680fs.rrze.uni-erlangen.de (Markus Kuhn)
Subject: mmap() not working with SLS 1.02?
Date: Fri, 14 May 1993 22:28:57 +0200
Reply-To: mskuhn@immd4.informatik.uni-erlangen.de

I have encountered a problem with the mmap() function while trying to
port two programs that run fine under SunOS 4.1.* to Linux 0.99pl9. After the
line

  start = mmap(NULL, length, PROT_READ, MAP_SHARED, fileno(f), 0);

start has the value (caddr_t) -1 and perror() prints 'Out of memory',
even if I have many megabytes free and length has only a value of 30000.
The problem appears with files from both local file systems and nfs.
I never managed to get a succesful memory mapped file under Linux.

Any ideas?

Markus

-- 
Markus Kuhn, Computer Science student «°o°» University of Erlangen, Germany
Internet: mskuhn@immd4.informatik.uni-erlangen.de  |  X.500 entry available
===================== Esstsonddringtswostsobibringts ======================

From: eric@tantalus.nrl.navy.mil (Eric Youngdale)
Subject: Re: mmap() not working with SLS 1.02?
Date: Wed, 19 May 1993 14:17:25 GMT

In article <1t0ve9E116@uni-erlangen.de> 
mskuhn@immd4.informatik.uni-erlangen.de writes:
>I have encountered a problem with the mmap() function while trying to
>port two programs that run fine under SunOS 4.1.* to Linux 0.99pl9. After the
>line
>
>  start = mmap(NULL, length, PROT_READ, MAP_SHARED, fileno(f), 0);
>
>start has the value (caddr_t) -1 and perror() prints 'Out of memory',
>even if I have many megabytes free and length has only a value of 30000.
>The problem appears with files from both local file systems and nfs.
>I never managed to get a succesful memory mapped file under Linux.
>
>Any ideas?

        The mmap() function is crippled in 0.99pl9, so it will not work as you
are attempting to use it.  Currently only /dev/mem and /dev/zero can be mmaped.
I have sent Linus patches that add a lot of the missing mmap() functionality,
and I hope that they will appear in the next kernel release.  Even with my
patches, changes to a mmaped image are not written back to the disk file,
however.

-Eric

-- 
"When Grigor Samsa woke up one morning from unsettling dreams, he
found himself changed in his bed into a monstrous vermin."
                                        -F. Kafka