Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Nov 2002 14:32:04 -0800
From:      Kirk McKusick <mckusick@beastie.mckusick.com>
To:        Garance A Drosihn <drosih@rpi.edu>
Cc:        arch@FreeBSD.ORG
Subject:   Re: Shared-memory version of <sys/queue.h> macros 
Message-ID:  <200211112232.gABMW459037409@beastie.mckusick.com>
In-Reply-To: Your message of "Mon, 11 Nov 2002 17:06:35 EST." <p05200f0db9f5d85c6d3e@[128.113.24.47]> 

next in thread | previous in thread | raw e-mail | index | archive | help
> Date: Mon, 11 Nov 2002 17:06:35 -0500
> To: Kirk McKusick <mckusick@McKusick.COM>, arch@FreeBSD.ORG
> From: Garance A Drosihn <drosih@rpi.edu>
> Subject: Re: Shared-memory version of <sys/queue.h> 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 <sys/queue.h>
> >to pull in the existing set of queue macros. The include of
> ><sys/queue.h> 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 <queue.h> or <sys/queue.h>? )
> 
> -- 
> 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, <sys/stat.h> 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 <stdio.h> which
describes purely userland structures like FILE *. However,
we canot move <sys/queue.h> 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 <queue.h>
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




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