From owner-freebsd-hackers Wed Dec 6 2: 6:50 2000 From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 6 02:06:47 2000 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from ns5.pacific.net.au (ns5.pacific.net.au [203.143.252.30]) by hub.freebsd.org (Postfix) with ESMTP id 8430B37B404 for ; Wed, 6 Dec 2000 02:06:45 -0800 (PST) Received: from dungeon.home (ppp52.dyn250.pacific.net.au [203.143.250.52]) by ns5.pacific.net.au (8.9.0/8.9.1) with ESMTP id VAA03320; Wed, 6 Dec 2000 21:06:39 +1100 (EST) Received: from dungeon.home (localhost [127.0.0.1]) by dungeon.home (8.11.1/8.9.3) with ESMTP id eB6A6o504244; Wed, 6 Dec 2000 20:06:50 +1000 (EST) (envelope-from mckay) Message-Id: <200012061006.eB6A6o504244@dungeon.home> To: Dag-Erling Smorgrav Cc: "G. Adam Stanislav" , Stephen McKay , hackers@FreeBSD.ORG Subject: Re: pipe References: <20001202085127.A301@int80h.org> <3A292D98.E655D755@softweyr.com> <20001203012841.B228@whizkidtech.net> <200012040256.eB42upH07905@dungeon.home> <20001205085645.A228@whizkidtech.net> <20001205110328.A228@whizkidtech.net> <20001205121423.A228@whizkidtech.net> In-Reply-To: from Dag-Erling Smorgrav at "06 Dec 2000 09:50:55 +0100" Date: Wed, 06 Dec 2000 20:06:50 +1000 From: Stephen McKay Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wednesday, 6th December 2000, Dag-Erling Smorgrav wrote: >"G. Adam Stanislav" 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