From: kaih@khms.westfalen.de (Kai Henningsen)
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: do_mmap
Date: 01 Jun 2002 13:12:00 +0200 [thread overview]
Message-ID: <8Q3lFMgmw-B@khms.westfalen.de> (raw)
In-Reply-To: <ad8bvv$3tr$1@penguin.transmeta.com>
torvalds@transmeta.com (Linus Torvalds) wrote on 31.05.02 in <ad8bvv$3tr$1@penguin.transmeta.com>:
> In article <1022855243.12888.410.camel@irongate.swansea.linux.org.uk>,
> Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> >On Fri, 2002-05-31 at 14:00, Thomas 'Dent' Mirlacher wrote:
> >> and the checks in various places are really strange. - well some
> >> places check for:
> >> o != NULL
> >> o > -1024UL
> >
> >"Not an error". Its relying as some other bits of code do actually that
> >the top mappable user address is never in the top 1K of the address
> >space
> >
> >> is it possible to have 0 as a valid address? - if not, this should
> >> be the return on errors.
> >
> >SuS explicitly says that 0 is not a valid mmap return address.
>
> But if so, SuS is _very_ _very_ wrong.
[...]
> and if SuS says that mmap must not return NULL for this case, then SuS
> is so full of sh*t that it's not worth worrying about.
Actually, at least SuSv3 does not say any such thing. *What* it says is
that the return is either MAP_FAILED or the correct address, and that if
it is called *without* MAP_FIXED, then the argument 0 has special meaning,
and it won't map something at 0 (and thus return 0) - which, AFAICT, is
exactly what we want it to say. Specifically, NULL is *never* an error
return value for mmap.
At least, unless we define MAP_FAILED to be NULL - traditionally, it's
(void *)-1 probably exactly so it is possible to return an address of 0.
See <http://www.opengroup.org/onlinepubs/007904975/functions/mmap.html>.
MfG Kai
next prev parent reply other threads:[~2002-06-01 11:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-31 13:00 do_mmap Thomas 'Dent' Mirlacher
2002-05-31 14:27 ` do_mmap Alan Cox
2002-05-31 13:33 ` do_mmap Thomas 'Dent' Mirlacher
2002-05-31 17:30 ` do_mmap Linus Torvalds
2002-05-31 17:46 ` do_mmap Thomas 'Dent' Mirlacher
2002-05-31 17:56 ` do_mmap Linus Torvalds
2002-05-31 18:10 ` do_mmap Richard B. Johnson
2002-05-31 18:21 ` do_mmap Thomas 'Dent' Mirlacher
2002-05-31 18:38 ` do_mmap Richard B. Johnson
2002-05-31 18:59 ` do_mmap Alan Cox
2002-06-01 11:12 ` Kai Henningsen [this message]
2002-05-31 19:49 ` do_mmap DervishD
2002-05-31 19:46 ` do_mmap DervishD
2002-06-03 12:19 ` do_mmap Pavel Machek
2002-06-03 19:13 ` do_mmap Thomas 'Dent' Mirlacher
2002-06-03 20:11 ` do_mmap Thomas 'Dent' Mirlacher
2002-06-03 20:25 ` do_mmap Pavel Machek
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=8Q3lFMgmw-B@khms.westfalen.de \
--to=kaih@khms.westfalen.de \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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