mapping file to memory

mapping file to memory

Post by gl.. » Sun, 28 Aug 1994 01:33:41



Hi,

I am looking for a function that will allow me to map the contents
of a file directly in memory.

This will avoid me having to open...read the stuff in.

I believe that Sun had some sort of function to do it. ??

(this will typically be a vendor supplied function...
 I can hack it if I want to )

I am working with hp-9000.... kit
I have scoured the documentation, maybe in my frustration I overlooked
it ?

suggestions ( no smart one - heard them before ) are welcome

Thanks

Glenn Stevenson

 
 
 

mapping file to memory

Post by Michael Salm » Mon, 29 Aug 1994 19:54:28


|> Hi,
|>
|> I am looking for a function that will allow me to map the contents
|> of a file directly in memory.
|>
|> This will avoid me having to open...read the stuff in.
|>
|>
|> I believe that Sun had some sort of function to do it. ??
|>
|> (this will typically be a vendor supplied function...
|>  I can hack it if I want to )
|>
|> I am working with hp-9000.... kit
|> I have scoured the documentation, maybe in my frustration I overlooked
|> it ?

Try man 2 mmap. Even HP-UX has it.

--

Michael Salmon

#include        <standard.disclaimer>
#include        <witty.saying>
#include        <fancy.pseudo.graphics>

Ericsson Telecom AB
Stockholm

 
 
 

mapping file to memory

Post by Mark Ha » Tue, 30 Aug 1994 07:31:44


Quote:> Try man 2 mmap. Even HP-UX has it.

in fact, hp-ux's (>= 9.01) is superior to the version in sunos (4.x).

also, note that conservative use of mmap is now "defacto portable",
since hpux, sunos, irix, osf, and linux all support it.  probably
aix as well.

regards, mark hahn.
--

 
 
 

mapping file to memory

Post by Michael Salm » Tue, 30 Aug 1994 15:20:07



|> > Try man 2 mmap. Even HP-UX has it.
|>
|> in fact, hp-ux's (>= 9.01) is superior to the version in sunos (4.x).

I always find it interesting to hear that hp has done something better,
how have they improved mmap(2).

--

Michael Salmon

#include        <standard.disclaimer>
#include        <witty.saying>
#include        <fancy.pseudo.graphics>

Ericsson Telecom AB
Stockholm

 
 
 

mapping file to memory

Post by Oliver Lauma » Tue, 30 Aug 1994 17:38:30


Quote:> in fact, hp-ux's (>= 9.01) [mmap] is superior to the version in sunos (4.x).

It *was* superior.  In HP-UX 8.x, you could specify the flag argument
MAP_REPLACE to establish a mapping that overlaps an already existing
mapping.  HP seems to have removed this functionality in HP-UX 9.0.
Has MAP_REPLACE been reintroduced in HP-UX 9.01?
 
 
 

mapping file to memory

Post by Michael Salm » Tue, 30 Aug 1994 18:02:08



|> > in fact, hp-ux's (>= 9.01) [mmap] is superior to the version in sunos (4.x).
|>
|> It *was* superior.  In HP-UX 8.x, you could specify the flag argument
|> MAP_REPLACE to establish a mapping that overlaps an already existing
|> mapping.  HP seems to have removed this functionality in HP-UX 9.0.
|> Has MAP_REPLACE been reintroduced in HP-UX 9.01?

I've made overlapping mappings in SVR4 and SunOS 4.1.1 without having
to specify any special flags and without any problems.

--

Michael Salmon

#include        <standard.disclaimer>
#include        <witty.saying>
#include        <fancy.pseudo.graphics>

Ericsson Telecom AB
Stockholm

 
 
 

mapping file to memory

Post by Oliver Lauma » Tue, 30 Aug 1994 18:39:27


Quote:> > It *was* superior.  In HP-UX 8.x, you could specify the flag argument
> > MAP_REPLACE to establish a mapping that overlaps an already existing
> > mapping.  HP seems to have removed this functionality in HP-UX 9.0.
> > Has MAP_REPLACE been reintroduced in HP-UX 9.01?

> I've made overlapping mappings in SVR4 and SunOS 4.1.1 without having
> to specify any special flags and without any problems.

Well, then it was at least superior insofar as you could control whether
or not regions should be permitted to overlap.

In HP-UX 09.05 (which is the most recent release we have), regions
must not overlap, and the MAP_REPLACE flag is gone (which is a pity,
because it breaks an application I have that requires that mappings
may overlap).

 
 
 

mapping file to memory

Post by Casper H.S. D » Tue, 30 Aug 1994 19:04:22



>> > It *was* superior.  In HP-UX 8.x, you could specify the flag argument
>> > MAP_REPLACE to establish a mapping that overlaps an already existing
>> > mapping.  HP seems to have removed this functionality in HP-UX 9.0.
>> > Has MAP_REPLACE been reintroduced in HP-UX 9.01?

>> I've made overlapping mappings in SVR4 and SunOS 4.1.1 without having
>> to specify any special flags and without any problems.
>Well, then it was at least superior insofar as you could control whether
>or not regions should be permitted to overlap.

Mapping do not overlap in SunOS/Solaris.  Newer mappings simply
replace older mappings.

Casper

 
 
 

mapping file to memory

Post by Oliver Lauma » Tue, 30 Aug 1994 19:21:39


Quote:> > Well, then it was at least superior insofar as you could control whether
> > or not regions should be permitted to overlap.

> Mapping do not overlap in SunOS/Solaris.  Newer mappings simply
> replace older mappings.

I thought it was clear from the context that it is the *regions*
that overlap, not the *mappings*.  Besides, I haven't invented
the terminology; it is used in the HP-UX manual page for mmap().
 
 
 

mapping file to memory

Post by Manfred Rosenbo » Wed, 31 Aug 1994 21:21:08


: I am looking for a function that will allow me to map the contents
: of a file directly in memory.

        Lookup mmap(2)/munmap(2) in the manuals (System V)

Manfred

 
 
 

1. Shared Memory,Memory mapped files and Threads

1. If thread 1 in a multithreaded application attaches to a shared memory
segment is it possible to guarantee that thread2 will not overwrite this shared
memoey segment?

2. Same question as it relates to memory-mapped file.

3. Can device drivers be used to achieve thread level insulation from shared
memory or memory mapped files?

4. What are the advantages of using memory-mapped files vs. shared memory?
(Issues such as system limits, process limits, size, performance, etc.)

5. Can you direct me to relevant material on the above mentioned topics (books,
web-sites, etc.)

Thank you.

Sincerely,

Sanjay Shrivastava.

2. Linux 2.2.1 problems on SMP machine

3. Shared memory, memory mapped files and threads

4. Try to install SuSE 7.3 on old ICS box -- Crash !

5. Password authentication with NetBSD 1.4.2

6. Can I create a file desriptor to a file mapped into memory?

7. Adeptec AHA-1535A adpater

8. async file i/o and memory mapped file info

9. memory mapped files and file cache

10. file mapping of memory (opposite of mmap())

11. Memory mapped file

12. Memory-Map File.....!!!