From owner-freebsd-current@FreeBSD.ORG Mon Oct 16 19:19:43 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F93F16A6DD; Mon, 16 Oct 2006 19:19:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 48E9243D5E; Mon, 16 Oct 2006 19:19:22 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k9GJJ9OP041974; Mon, 16 Oct 2006 15:19:18 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Mon, 16 Oct 2006 14:31:24 -0400 User-Agent: KMail/1.9.1 References: <20061015135710.A28897E98D@FreeBSD.csie.nctu.edu.tw> <20061016011559.W61639@delplex.bde.org> In-Reply-To: <20061016011559.W61639@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610161431.25228.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 16 Oct 2006 15:19:19 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/2037/Mon Oct 16 12:41:42 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: freebsd-bugs@freebsd.org, Cheng-Lung Sung , FreeBSD-gnats-submit@freebsd.org, Bruce Evans , freebsd-current@freebsd.org Subject: Re: kern/104436: [PATCH] sys/sem.h should include sys/types.h X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2006 19:19:43 -0000 On Sunday 15 October 2006 11:21, Bruce Evans wrote: > On Sun, 15 Oct 2006, Cheng-Lung Sung wrote: > > > System: FreeBSD.csie.nctu.edu.tw 6.1-STABLE FreeBSD 6.1-STABLE #9: Thu May 11 14:31:45 CST 2006 root@FreeBSD.csie.nctu.edu.tw:/home/usr.obj/usr/src/sys/FREEBSD i386 > > > >> Description: > > - sys/sem.h has included sys/ipc.h, which includes sys/_types.h > > but it (and its including files) does not include sys/types.h > > - therefore, in sys/sem.h struct semid_ds declares "time_t sem_otime;" ...etc > > - if we only compile a program which do not include sys/types.h, it will fail. > > Including sys/types.h would add lots of namespace pollution which > sys/ipc.h and sys/sem.h are trying hard to avoid. sem.h is trying too > hard -- POSIX requires it to declare time_t (and pid_t, key_t and size_t, > which it already declares). Is this better? Index: sem.h =================================================================== RCS file: /usr/cvs/src/sys/sys/sem.h,v retrieving revision 1.29 diff -c -r1.29 sem.h *** sem.h 17 Nov 2004 13:12:06 -0000 1.29 --- sem.h 16 Oct 2006 18:30:05 -0000 *************** *** 111,116 **** --- 111,121 ---- #define _SIZE_T_DECLARED #endif + #ifndef _TIME_T_DECLARED + typedef __time_t time_t; + #define _TIME_T_DECLARED + #endif + #ifndef _PID_T_DECLARED typedef __pid_t pid_t; #define _PID_T_DECLARED (it looks like pid_t should be before size_t in sem.h btw) -- John Baldwin