9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@coraid.com>
To: 9fans@9fans.net
Subject: Re: [9fans] segattach off-by-one?
Date: Fri, 25 Sep 2009 14:18:33 -0400	[thread overview]
Message-ID: <c9ec513f16d4318316f9c8d8883b6ca9@coraid.com> (raw)
In-Reply-To: <f75780240909251101l1fb7bf3drb52c1a5cdcf4f034@mail.gmail.com>

On Fri Sep 25 14:11:03 EDT 2009, me@acm.jhu.edu wrote:
> So in my example, va = 0x10001001, len = 0x1000. I understood that to
> mean [0x10001001, 0x10002001) was the newly-valid interval, which
> would mean 0x10002000 was a valid address...

i think you're misreading the man page.  from the man page
	Segattach creates a new memory segment, adds it to the call-
	ing process's address space, and returns its lowest address.
so you need to use the value returned, not the value
you gave it.  in this case 0x10001000 not 0x0001001.

also from the man page
	Va and len specify the position of the segment in the
	process's address space.  Va is rounded down to the nearest
	page boundary and va+len is rounded up.  The system does not
so va is rounded down (as you see) and the length
is rounded up, also as you see.

- erik



  reply	other threads:[~2009-09-25 18:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <<f75780240909242033k11fb23a0o237f7dbedf9a7bee@mail.gmail.com>
2009-09-25  4:34 ` erik quanstrom
2009-09-25 18:01   ` Venkatesh Srinivas
2009-09-25 18:18     ` erik quanstrom [this message]
2009-09-25 18:32       ` erik quanstrom
2009-09-25  3:33 Venkatesh Srinivas

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=c9ec513f16d4318316f9c8d8883b6ca9@coraid.com \
    --to=quanstro@coraid.com \
    --cc=9fans@9fans.net \
    /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).