From: Ara.T.Howard@... Date: 2004-09-07T23:45:14+09:00 Subject: Re: Ruby/HPUX/syscall problem/bug On Tue, 7 Sep 2004 tad.bochan@bnpparibas.com wrote: > Hello, I need a little help please. > If anyone on the list is running ruby on hpux 11+ with a ruby > version later than "ruby 1.8.0 (2003-08-04) [hppa2.0w-hpux11.11]", > could you please try the following code to see if the problem/bug > has been fixed in the later version ?. > TIA. > Tad. > > sysfunc="SYS_mmap" > lib="/usr/include/sys/scall_define.h" > scall=open(lib).readlines.grep(/\s#{sysfunc}\s/)[0].split[2].to_i > puts "#{sysfunc} = #{scall}" > SYS_mmap = 71 > PROT_NONE = 0 > PROT_USER = 0 > PROT_READ = 1 > PROT_WRITE = 2 > MAP_SHARED = 1 > addr,len,prot,flags,ofs=0,80,PROT_READ, MAP_SHARED,0 > filedes=open("shmfile","a+") > mmfptr=syscall(SYS_mmap, addr, len, prot, flags, filedes.fileno, ofs) > > On my system, this fails with the following error report, > >> ruby pntrs.rb > SYS_mmap = 71 > pntrs.rb:13: [BUG] rb_sys_fail() - errno == 0 > ruby 1.8.0 (2003-08-04) [hppa2.0w-hpux11.11] > > Abort(coredump) i can't help you with the hpux problem - but have you tried to compile guy's mmap module? i use it all the time and it's very good - seems like that would be easier that using syscall... cheers. -a -- =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | A flower falls, even though we love it; | and a weed grows, even though we do not love it. | --Dogen ===============================================================================