Re: mmap trouble

Bill Hawes (
Fri, 11 Jul 1997 14:04:07 -0400

Valerij Shchedrin wrote:
> Hello All!
> When I create file and write to it something (file size != 0), then all is
> OK. But when open creates new file, or opens file with size == 0, then
> SIGBUS occurs. Why??? (I use 2.0.30 kernel). As gdb says SIGBUS occurs on
> first write to buf asm instruction (in strcpy). Any cure????

Your program makes the file a shared mapping, and writing past the end
of a shared mapping generates a SIGBUS. Try making it a private