On Wednesday, 6th December 2000, Dag-Erling Smorgrav wrote:

>"G. Adam Stanislav" <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to