mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: root@chaos.analogic.com
Cc: "Srinivas G." <srinivasg@esntechnologies.co.in>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Having problem with mmap system call!!!
Date: Thu, 16 Sep 2004 21:01:16 +0100	[thread overview]
Message-ID: <1095364875.22750.45.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.53.0409161404001.13362@chaos>

On Iau, 2004-09-16 at 19:13, Richard B. Johnson wrote:

> 	for (i = 0; i < v->page_count; i++) {
> 		unsigned long page = virt_to_phys((void *)v->desc[i]);
> 		if (remap_page_range(start, page, PAGE_SIZE, PAGE_READONLY)) {
> 			err = -EAGAIN;
> 			goto out;
> 		}
> 		start += PAGE_SIZE;

Actually thats a nice example of how easy it is to implement mmap
properly.


> you usually say... Anyway are you aware that ...
> 
> 	unsigned long size  = vma->vm_end - vma->vm_start;
> 
> ... ends up being 32 bytes longer than the length the user-mode
> code put into mmap()?

Its page aligned, that is what mmap() says happens.


  reply	other threads:[~2004-09-16 21:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4EE0CBA31942E547B99B3D4BFAB348111078FE@mail.esn.co.in>
2004-09-16 14:07 ` Richard B. Johnson
2004-09-16 13:31   ` Alan Cox
2004-09-16 14:54     ` Richard B. Johnson
2004-09-16 15:57       ` Alan Cox
2004-09-16 18:13         ` Richard B. Johnson
2004-09-16 20:01           ` Alan Cox [this message]
2004-09-16 14:42 Srinivas G.

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=1095364875.22750.45.camel@localhost.localdomain \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=root@chaos.analogic.com \
    --cc=srinivasg@esntechnologies.co.in \
    /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

all inboxes | Powered by JetHome®