Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 06 Dec 2000 20:06:50 +1000
From:      Stephen McKay <mckay@thehub.com.au>
To:        Dag-Erling Smorgrav <des@ofug.org>
Cc:        "G. Adam Stanislav" <adam@whizkidtech.net>, Stephen McKay <mckay@thehub.com.au>, hackers@FreeBSD.ORG
Subject:   Re: pipe 
Message-ID:  <200012061006.eB6A6o504244@dungeon.home>
In-Reply-To: <xzpzoiaq6fk.fsf@flood.ping.uio.no> from Dag-Erling Smorgrav at "06 Dec 2000 09:50:55 %2B0100"
References:  <20001202085127.A301@int80h.org> <3A292D98.E655D755@softweyr.com> <20001203012841.B228@whizkidtech.net> <200012040256.eB42upH07905@dungeon.home> <20001205085645.A228@whizkidtech.net> <xzpwvdesx2q.fsf@flood.ping.uio.no> <20001205110328.A228@whizkidtech.net> <xzpitoyssid.fsf@flood.ping.uio.no> <20001205121423.A228@whizkidtech.net> <xzpzoiaq6fk.fsf@flood.ping.uio.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday, 6th December 2000, Dag-Erling Smorgrav wrote:

>"G. Adam Stanislav" <adam@whizkidtech.net> writes:
>> I know it addresses it. Unfortunately, I didn't understand a word of it.

>     MAP_ANON    Map anonymous memory not associated with any specific file.
>                 The file descriptor used for creating MAP_ANON must be -1.
>                 The offset parameter is ignored.
>
>This means you can mmap() memory that isn't associated with a file by
>passing -1 instead of a file descriptor and adding MAP_ANON to flags.

I think you are being too hard on the guy.  It's not at all obvious
that mmap() can be used to allocate memory.

Read the first sentence of the manual to see what mmap() used to be about.
It was a way to avoid read() and write() calls.  All this MAP_ANON memory
allocation stuff came later.

If I were new to Unix, I wouldn't be looking around for anonymous
memory mapping primitives as a way to implement malloc().  It has only
been a good way to do that in recent times.

While I don't like to see people shooting themselves in the foot by
using the wrong system calls, I don't think we need to hammer them
into the dirt to change their minds.

Stephen.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200012061006.eB6A6o504244>