From: Florian Gross Date: 2004-08-27T04:05:35+09:00 Subject: Re: Dereferencing pointers returned by syscall tad.bochan@bnpparibas.com wrote: > Hi, Moin! > I'm using 'syscall' in ruby to access the 'mmap' function in Unix (HPUX), > to try to read/write a memory-mapped file. > The 'mmap' function returns a pointer to the mapped file. > I can't figure out how I am supposed to be able to use > this pointer to access the data from ruby. Have a look at Ruby/DL which is part of Standard Ruby. With DL::Importable you can create a struct like this: Foo = struct [ "long foo", "int bar", ... ] And later you can do Foo.new(DL::PtrData.new(ptr)). Regards, Florian Gross