From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,a7c397921f0cefda X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1991-11-13 12:18:05 PST Path: gmdzi!ieee.org!europa.asd.contel.com!darwin.sura.net!gatech!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!usenet.coe.montana.edu!osyjm From: osyjm@coe.montana.edu (Jaye Mathisen) Newsgroups: comp.sys.dec Subject: Re: Why won't mmap work on my Ultrix 4.2 Decstation 5000 ? Message-ID: <1991Nov13.194205.27850@coe.montana.edu> Date: 13 Nov 91 19:42:05 GMT References: Organization: Montana State University In article peterf@olivine.csis.dit.csiro.au (Peter A Fletcher) writes: >Hello everyone! > >I have been having some problems with my Decstation; it won't do mmaps >for me. The following piece of code works fine on Suns and Apollos, >but fails with an invalid argument on the mmap call on my Decstation. >#include >#include >#include >#include >#include >#include > >main() > >{ > int d; > int len = getpagesize(); > char *cp; > int i; > int z; > > d = open("test", O_RDWR | O_CREAT | O_TRUNC, 0777); > z = lseek(d, 255, L_XTND); > z = write(d, &i, 1); > >#ifdef apollo > cp = mmap(0, &len, PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, d, 0); >#else > cp = mmap(0, len, PROT_READ | PROT_WRITE, MAP_SHARED, d, 0); >#endif mmap as documented on the man page only supports character devices... -- Jaye Mathisen, COE Systems Manager (406) 994-4780 410 Roberts Hall,Dept. of Computer Science Montana State University,Bozeman MT 59717