Bug in mmap and TMPFS under SunOS 4.1.1

Russ Poffenberger poffen at sj.ate.slb.com
Thu Mar 28 07:35:00 AEST 1991


There seems to be a bug in SunOS 4.1.1 with the mmap() call on a file
residing on a TMPFS filesystem. According to the man pages for mmap..

     mmap() allows [pa, pa + len) to extend beyond the end of the
     object, both at the time of the mmap() and while the mapping
     persists, for example if the file was created just prior  to
     the mmap() and has no contents, or if the file is truncated.
     Any reference to addresses beyond the  end  of  the  object,
     however, will result in the delivery of a SIGBUS signal.

This is fine on a normal filesystem, however attempting to map beyond the
end of an object, where that object is a file residing on a TMPFS
filesystem will cause mmap to fail with a bad status (-1).

This has been reported to Sun (our PAL contact), but I have received no
response yet. *FLAME ON* I am not thrilled with our PAL service to date.
*FLAME OFF*.

There is certainly a workaround, not to map past the end of the object,
but either the problem should be fixed, or the man page updated to reflect
the truth.

Russ Poffenberger               DOMAIN: poffen at sj.ate.slb.com
Schlumberger Technologies       UUCP:   {uunet,decwrl,amdahl}!sjsca4!poffen
1601 Technology Drive		CIS:	72401,276
San Jose, Ca. 95110             (408)437-5254



More information about the Comp.sys.sun mailing list