[comp.sys.hp] HP-UX 8.0: memory mapped files?

schorr@ead.dsa.com (Andrew J. Schorr) (04/25/91)

I'm a Sun user that is very impressed (isn't everyone) with the
new 700 series.  I would consider purchasing these machines, but
have never used HP-UX.

From reading various messages in this group, I have gotten
the following impressions: 1. HP-UX 8.0 supports shared libraries;
2. HP-UX 8.0 does NOT support memory-mapping of files.

Is point 2 correct?  If so, how does HP-UX implement shared libraries?
Certainly under SunOS, the shared libraries are brought into the
process address space by mapping the files.

What's the real story?  In my opinion, memory-mapping is a very
powerful tool, and one I am not eager to do without.

-Andy

mjs@hpfcso.FC.HP.COM (Marc Sabatella) (04/30/91)

>From reading various messages in this group, I have gotten
>the following impressions: 1. HP-UX 8.0 supports shared libraries;
>2. HP-UX 8.0 does NOT support memory-mapping of files.
>
>Is point 2 correct?  If so, how does HP-UX implement shared libraries?
>Certainly under SunOS, the shared libraries are brought into the
>process address space by mapping the files.

Your assessment is correct.  HP-UX shared libraries use an internal mechanism
similar in concept to memory mapped files in SunOS, but there is no supported
interface to this mechanism in 8.0

--------------
Marc Sabatella (marc@hpmonk.fc.hp.com)
Disclaimers:
	2 + 2 = 3, for suitably small values of 2
	Bill and Dave may not always agree with me

sasebb@zen.unx.sas.com (Edmund Burnette) (05/03/91)

In article <7370382@hpfcso.FC.HP.COM>, mjs@hpfcso.FC.HP.COM (Marc Sabatella) writes:
|> Your assessment is correct.  HP-UX shared libraries use an internal mechanism
|> similar in concept to memory mapped files in SunOS, but there is no supported
|> interface to this mechanism in 8.0

Hi Marc.  I'm concerned about your comment here about "no supported interface".
In 8.01 on the 700, the file /usr/include/sys/mman.h exists, and the mmap() and
related calls exist in syscall.h and in the system libraries.  Do you mean
people should avoid it in this release because HP knows it doesn't work,
doesn't guarantee it will work, didn't document it, or because it might change
in the future?  Will it be better supported in 8.05?  As you know we'd like to
use it in our debugger but will (reluctantly) avoid it if HP tells us to
definitely stay away from it (or doesn't fix bugs in it).
--
Edmund Burnette, SAS Institute Inc.    (919)677-8000 | sasebb@unx.sas.com
SAS Campus Drive, Cary, NC 27513  (919)677-8123(fax) | ...!mcnc!sas!sasebb

fkittred@bbn.com (Fletcher Kittredge) (05/04/91)

In article <1991Apr25.092827@ead.dsa.com> schorr@ead.dsa.com (Andrew J. Schorr) writes:
>I'm a Sun user that is very impressed (isn't everyone) with the
>new 700 series.  I would consider purchasing these machines, but
>have never used HP-UX.
>
>From reading various messages in this group, I have gotten
>the following impressions: 1. HP-UX 8.0 supports shared libraries;
>2. HP-UX 8.0 does NOT support memory-mapping of files.
>
>Is point 2 correct?  If so, how does HP-UX implement shared libraries?
>Certainly under SunOS, the shared libraries are brought into the
>process address space by mapping the files.
>
>What's the real story?  In my opinion, memory-mapping is a very
>powerful tool, and one I am not eager to do without.
>
>-Andy

Andy;

	The current version of HP-UX 8.0 dosn't seem to support memory
mapped files; there is no mmap syscall.  However, in the next six to
nine months, OSF/1 will be available on the 700s.  OSF/1 has a much
more sophisticated set of memory mapping functions than current Sun O/S.

regards,
fletcher



Fletcher Kittredge
Senior Engineer, BBN Software Products
150 CambridgePark Dr,  Cambridge, MA. 02140
617-873-3465  /  fkittred@bbn.com  /  fkittred@das.harvard.edu

vandys@sequent.com (Andrew Valencia) (05/04/91)

fkittred@bbn.com (Fletcher Kittredge) writes:

>	The current version of HP-UX 8.0 dosn't seem to support memory
>mapped files; there is no mmap syscall.

Oh, hell.  I can't resist.

I ported the HP-UX 8.0 VM system to the 300 series before I left HP.
While I don't know if they've really sealed it off for release, I can tell
you that exec(), shared libraries, etc. are all based on top of true
memory mapped files.  In fact, if I'm reading into Mr. Sabatella's paper
(on shared libraries) correctly, a user-level interface must exist.

From the release literature, I take it that they certainly are not
documenting/supporting memory mapped files yet.  But how are OS
maintainers going to get their grey hair if you guys don't go out and
monkey with the unsupported interfaces? :-)

If somebody goes for it, please post and tell us if they found whether
read/write is coherent with the mmap'ed region or not.  I'd just love
to know how far they got.

				I'll go back to my hole now...
				Andy Valencia
				vandys@sequent.com

dms@tiger.ai.mit.edu (David M. Siegel) (05/06/91)

In article <1991May4.045735.28909@sequent.com>, vandys@sequent.com (Andrew Valencia) writes:
|> If somebody goes for it, please post and tell us if they found whether
|> read/write is coherent with the mmap'ed region or not.  I'd just love
|> to know how far they got.

I just tried a few simple tests with mmap on 8.0 on a Snake.  Using
MAP_PRIVATE works fine.  It seems that writes with MAP_SHARED don't
work.  You get a SEGV.

-Dave

mjs@hpfcso.FC.HP.COM (Marc Sabatella) (05/09/91)

/ hpfcso:comp.sys.hp / vandys@sequent.com (Andrew Valencia) / 10:57 pm  May  3, 1991 /

>But how are OS
>maintainers going to get their grey hair if you guys don't go out and
>monkey with the unsupported interfaces? :-)

Gee, thanks, Andy!  OK, he and other observant posters are right, there is
an entry point for mmap, which we can't prevent you from calling :-)

>If somebody goes for it, please post and tell us if they found whether
>read/write is coherent with the mmap'ed region or not.  I'd just love
>to know how far they got.

You can't write to an mmap'ed file at all - PROT_WRITE only works with
MAP_PRIVATE (ie, copy on write), so coherency isn't a problem.  Well, I suppose
someone could write to the file through normal means, although they'd have to
do it over NFS or they'd get ETXTBUSY.  As I said, mmap() is in place for
shared libraries only, and using mmap() to write the file was not required, so
it isn't implemented.

--------------
Marc Sabatella (marc@hpmonk.fc.hp.com)
Disclaimers:
	2 + 2 = 3, for suitably small values of 2
	Bill and Dave may not always agree with me