From: Denis Zaitsev <zzz@cd-club.ru>
To: linux-c-programming@vger.kernel.org
Subject: shared mapping of /dev/zero
Date: Fri, 8 Nov 2002 17:24:16 +0500 [thread overview]
Message-ID: <20021108172415.A22564@natasha.zzz.zzz> (raw)
I'm trying to do something like the anonymous mapping of the same
memory region thru a different virtual addresses. I.e.:
char *a, *b;
int z= open("/dev/zero", O_RDWR);
a= mmap(NULL, 0x2000, PROT_READ|PROT_WRITE, MAP_SHARED, z,0);
b= mmap(a+0x1000, 0x1000, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FIXED, z,0);
And what I have as the result, are two mapping as if they was created
with MAP_ANONYMOUS flag, so they do not share the same space (of file
desc z, at offset 0), as required. So, mapping of /dev/zero is just
the synonum for the anonymous mapping... Is this the correct
behaviour, and if so, what is the way to do the trick?
Thanks in advance...
next reply other threads:[~2002-11-08 12:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-08 12:24 Denis Zaitsev [this message]
2002-11-08 17:54 ` shared mapping of /dev/zero Glynn Clements
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021108172415.A22564@natasha.zzz.zzz \
--to=zzz@cd-club.ru \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).