> I'm using 'syscall' in ruby to access the 'mmap'  function in Unix
(HPUX),
> to try to read/write a memory-mapped file.

Don't know much about that, but there is an mmap library for Ruby on the
RAA:
http://raa.ruby-lang.org/project/mmap/.