[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4ED8C275.7020907@univ-mlv.fr>
Date: Fri, 02 Dec 2011 13:20:05 +0100
From: Sébastien Paumier
<sebastien.paumier@...v-mlv.fr>
To: linux-kernel@...r.kernel.org
Subject: mmap
Hi,
I have a question about mmap's behavior when one tries to map a file asking for
a length greater than the actual file size. When I run the attached code on a
100 bytes file, I have the following output:
(... file content followed by zeros...)
n=4096
write: Bad address
So, it seems that the actual memory area provided by mmap is one page large and
not the requested length of filesize+10000. I guess that 'write' writes less
than requested because it was interrupted by the SIGBUS signal. And my question is:
shouldn't mmap either complain about the requested length or provide an
accessible area of the requested length, instead of silently failing ?
Best regards,
Sébastien Paumier
View attachment "mmap.c" of type "text/x-csrc" (885 bytes)
Powered by blists - more mailing lists