From: Brian Feldman Date: 2004-05-25T11:27:50+09:00 Subject: Re: compiling mmap? On Tue, May 25, 2004 at 04:04:53AM +0900, Mark Hubbart wrote: > > On May 24, 2004, at 9:43 AM, ts wrote: > > >#!/usr/bin/ruby > >require 'mmap' > >m0 = Mmap.new("/tmp/aa", "a") > >m0 << "abcdef" > >puts m0 > >File.open("/tmp/bb", "w") {|f| f.puts "aaa" } > >m1 = Mmap.new("/tmp/bb", "w") > >m1 << "abcdef" > >puts m1 > > mark@imac% pbpaste | ruby > # > -:8: [BUG] Bus Error > ruby 1.9.0 (2004-04-11) [powerpc-darwin] > > zsh: done pbpaste | > zsh: abort ruby > > > > it looks like the second test... Looks like Darwin does not automatically translate PROT_WRITE into PROT_READ | PROT_WRITE. The concept of write-only memory regions in userland programs is pretty strange... disassemble the instruction currently executing and it's probably a RMW instruction. Allowing the user to specify PROT_WRITE alone probably shouldn't happen in Ruby. -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\