From: osyjm@coe.montana.edu (Jaye Mathisen)
Subject: Re: Why won't mmap work on my Ultrix 4.2 Decstation 5000 ?
Date: 13 Nov 91 19:42:05 GMT [thread overview]
Message-ID: <1991Nov13.194205.27850@coe.montana.edu> (raw)
In-Reply-To: PETERF.91Nov12215047@olivine.csis.dit.csiro.au
In article <PETERF.91Nov12215047@olivine.csis.dit.csiro.au> 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 <sys/errno.h>
>#include <sys/file.h>
>#include <sys/types.h>
>#include <sys/uio.h>
>#include <sys/mman.h>
>#include <stdio.h>
>
>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
prev parent reply other threads:[~1991-11-13 19:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1991-11-12 11:50 Why won't mmap work on my Ultrix 4.2 Decstation 5000 ? Peter A Fletcher
1991-11-13 19:42 ` Jaye Mathisen [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox