From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 10 18:00:42 2005 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 69C8B16A41F for ; Wed, 10 Aug 2005 18:00:42 +0000 (GMT) (envelope-from drosih@rpi.edu) Received: from smtp4.server.rpi.edu (smtp4.server.rpi.edu [128.113.2.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id E1C8143D53 for ; Wed, 10 Aug 2005 18:00:41 +0000 (GMT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp4.server.rpi.edu (8.13.0/8.13.0) with ESMTP id j7AI0Zkm016207; Wed, 10 Aug 2005 14:00:36 -0400 Mime-Version: 1.0 Message-Id: In-Reply-To: <200508101006.j7AA6VCB037633@musashi.et.bocholt.fh-gelsenkirchen.de> References: <200508101006.j7AA6VCB037633@musashi.et.bocholt.fh-gelsenkirchen.de> Date: Wed, 10 Aug 2005 14:00:35 -0400 To: Dirk GOUDERS From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-CanItPRO-Stream: default X-RPI-SA-Score: undef - spam-scanning disabled X-Scanned-By: CanIt (www . canit . ca) on 128.113.2.4 Cc: hackers@freebsd.org Subject: Re: Include files that depend on include files X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2005 18:00:42 -0000 At 12:06 PM +0200 8/10/05, Dirk GOUDERS wrote: > > To get around this in user-space, we do things like create > > /usr/include/sys/_types.h > > > > And then our include files include *that* file, and do not include > > the standard . This file, in turn, does > > not define any of the actual symbols. Let's say that some include > > file needs to know what typedef for 'off_t' is. The sys/_types.h > > file defines __off_t, and then the include file which needs off_t > > will do something like: > > > > #include > > #ifndef _OFF_T_DECLARED > > typedef __off_t off_t; > > #define _OFF_T_DECLARED > > #endif > > > > Thus, it has only defined the one name it actually needs, instead > > of defining all of the standard symbols in the real sys/types.h. > >Can you point me to a real-life example where such a mechanism is >used? I'd like to have a closer look at it. The above lines came from FreeBSD's /usr/include/sys/stat.h Note that it includes and not There are many other examples in the FreeBSD system includes, at least once you get to the 5.x-series of FreeBSD. I don't remember if we were doing that in the 4.x-series. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu