From owner-freebsd-arch Mon Nov 11 14:32: 7 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3B9CC37B401 for ; Mon, 11 Nov 2002 14:32:06 -0800 (PST) Received: from beastie.mckusick.com (beastie.mckusick.com [209.31.233.184]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9A9F743E6E for ; Mon, 11 Nov 2002 14:32:05 -0800 (PST) (envelope-from mckusick@beastie.mckusick.com) Received: from beastie.mckusick.com (localhost [127.0.0.1]) by beastie.mckusick.com (8.12.3/8.12.3) with ESMTP id gABMW459037409; Mon, 11 Nov 2002 14:32:04 -0800 (PST) (envelope-from mckusick@beastie.mckusick.com) Message-Id: <200211112232.gABMW459037409@beastie.mckusick.com> To: Garance A Drosihn Subject: Re: Shared-memory version of macros Cc: arch@FreeBSD.ORG In-Reply-To: Your message of "Mon, 11 Nov 2002 17:06:35 EST." Date: Mon, 11 Nov 2002 14:32:04 -0800 From: Kirk McKusick Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > Date: Mon, 11 Nov 2002 17:06:35 -0500 > To: Kirk McKusick , arch@FreeBSD.ORG > From: Garance A Drosihn > Subject: Re: Shared-memory version of macros > > At 9:32 AM -0800 11/10/02, Kirk McKusick wrote: > >Since these are not needed by the kernel, I propose to create a > >new file /usr/include/queue.h which will contain the new shared > >memory version of the queue macros and also include > >to pull in the existing set of queue macros. The include of > > is to avoid duplication and possible divergence > >of the original macro set. > > Hmm. So, as a question of include-file naming, does "sys/" imply > that it's tied to the system kernel in some sense? I mean, why > would this imply "queue.h", while the earlier macros imply > "sys/queue.h"? > > (I'm just wondering. Certainly the changes seem fine to me. But > if I'm using the older macros in some userland program, should I > reference or ? ) > > -- > Garance Alistair Drosehn = gad@gilead.netel.rpi.edu > Senior Systems Programmer or gad@freebsd.org > Rensselaer Polytechnic Institute or drosih@rpi.edu Historically /usr/include/sys was used to include files that provided headers that included interfaces between the kernel and userland. For example, describes that stat structure which is filled in by the kernel and used by userland applications. Since the queue macros do not describe any kernel/userland shared structures, they belong in /usr/include. They are much more like which describes purely userland structures like FILE *. However, we canot move from the /sys/sys directory as it is needed by the kernel (indeed was originally developed for the kernel) as there is another rule which says that the kernel headers need to be self contained (that is the kernel cannot depend on anything in /usr/include). So, there is the dilemma of duplicating the queue macros used in the kernel in a /usr/include file, or trying to avoid divergence by pulling in the kernel macros from /usr/include/sys. As for what userland applications should do, once exists, they should always use that file. Kirk McKusick To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message