🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.unix.programmer
3 messages
3 total messages Started by Richard Coleman Mon, 01 Oct 1990 16:13
mmap() system call
#952
Author: Richard Coleman
Date: Mon, 01 Oct 1990 16:13
9 lines
624 bytes
-- 
I was looking at the system call mmap().  I not sure what
the purpose of this system call is.  Could someone help.


           Richard Coleman
           G.E. Simulation & Control Systems
           coleman@sunny.dab.ge.com
Re: mmap() system call
#955
Author: Conor P. Cahill
Date: Tue, 02 Oct 1990 02:26
17 lines
1180 bytes
In article <5994@ge-dab.GE.COM> coleman@sundae9.DAB.GE.COM (Richard Coleman) writes:
>I was looking at the system call mmap().  I not sure what
>the purpose of this system call is.  Could someone help.

On systems that support it, it allows you to map a portion (or all) of a 
file into your memory space.

This allows you to change the contents of the file by simply assigning
to the data area in your mapped area.  For example, if mmptr is a pointer
to the memory mapped region, memset(mmptr,'\0',512); will clear the first
512 bytes of the file.


-- 
Conor P. Cahill            (703)430-9247        Virtual Technologies, Inc.,
uunet!virtech!cpcahil                           46030 Manekin Plaza, Suite 160
                                                Sterling, VA 22170 
Re: mmap() system call
#966
Author: James Symon
Date: Wed, 03 Oct 1990 13:07
20 lines
1220 bytes
In article <5994@ge-dab.GE.COM>, coleman@sundae9.DAB.GE.COM (Richard Coleman) writes:
> 
> I was looking at the system call mmap().  I not sure what
> the purpose of this system call is.  Could someone help.
> 

Besides regular files, the file that you map to your program`s data
space can be some device. The call to mmap() will use the mmap routine
from the device driver. This method is often used with custom hardware
to allow direct access to device registers through program variables.
With root permission you can memory map directly to bus addresses, at
least on Suns, using the various address spaces such as vme24d16. If
you have Sun documentation look at the document about writing device
drivers. I`ve also seen a book about writing UNIX device drivers that
can help you understand mmap().

Jim Symon
symon@radonc.unc.edu
symon@cs.unc.edu
(919) 966-7710
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads