Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!tecate.mips.com!trevc From: trevc@tecate.mips.com (Trevor Cotton) Newsgroups: comp.sys.mips Subject: Re: mmap Message-ID: <4210@spim.mips.COM> Date: 3 Jun 91 16:47:15 GMT References: <1991Jun3.151307.20857@watdragon.waterloo.edu> Sender: news@mips.COM Reply-To: trevc@mips.com Distribution: na Organization: Mips Computer Systems Inc., Sunnyvale, CA Lines: 43 Nntp-Posting-Host: tecate.mips.com In article <1991Jun3.151307.20857@watdragon.waterloo.edu>, drclark@daisy.waterloo.edu (David R. Clark) writes: |> The following program (actually a slight variation of it) works on one of |> our local systems (Sequent). On an M2000 running 4.51 the call to mmap fails |> (invalid arguments). Any ideas? What I really want to do is choose an arbitrary |> region of memory that does not overlap the current program or data space and then |> map data into the region. Until I get the simple version working though, I am stuck. |> |> #include |> #include |> #include |> main() { |> |> int f; |> int t; |> char *s; |> |> f = open("AND",O_RDWR,0); |> |> if (f == -1) perror("open"); |> |> s = malloc(getpagesize()); |> if (mmap(s,getpagesize(),PROT_READ|PROT_WRITE,MAP_SHARED,f,0) == -1) |> perror("mmap"); |> printf("%s",s); |> } RISC/os 4.5x supports only a subset of the mmap and munmap system calls. Only mapping of character devices is allowed, and only one device can be mapped by a process. What is "AND" in your example? RISC/os 5.0 will add memory mapped file functionality that operates in accordance with SVR4 semantics. We hope to start beta testing of RISC/os 5.0 around the end of July. -- --trevc-- Trevor Cotton, Sustaining Engineering, MIPS Computer Systems Inc. MS 6-05, 930 DeGuigne Drive, Sunnyvale, CA 94088-3650 Tel: +1 408 524 7286 Fax: +1 408 524 7521 Email: {wyse,ames,decwrl,pyramid}!mips!trevc trevc@mips.com