From owner-freebsd-current@FreeBSD.ORG Tue Oct 17 02:13:34 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 813E916A403; Tue, 17 Oct 2006 02:13:34 +0000 (UTC) (envelope-from clsung@FreeBSD.csie.nctu.edu.tw) Received: from FreeBSD.csie.nctu.edu.tw (freebsd.csie.nctu.edu.tw [140.113.17.209]) by mx1.FreeBSD.org (Postfix) with ESMTP id F1DE843D53; Tue, 17 Oct 2006 02:13:33 +0000 (GMT) (envelope-from clsung@FreeBSD.csie.nctu.edu.tw) Received: from localhost (localhost.csie.nctu.edu.tw [127.0.0.1]) by FreeBSD.csie.nctu.edu.tw (Postfix) with ESMTP id A50077E93C; Tue, 17 Oct 2006 10:14:08 +0800 (CST) Received: from FreeBSD.csie.nctu.edu.tw ([127.0.0.1]) by localhost (FreeBSD.csie.nctu.edu.tw [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id In-c55vOFY8P; Tue, 17 Oct 2006 10:14:08 +0800 (CST) Received: by FreeBSD.csie.nctu.edu.tw (Postfix, from userid 1038) id 0A4DD7E93D; Tue, 17 Oct 2006 10:14:08 +0800 (CST) Date: Tue, 17 Oct 2006 10:14:07 +0800 From: Cheng-Lung Sung To: John Baldwin Message-ID: <20061017021407.GA738@FreeBSD.csie.nctu.edu.tw> References: <20061015135710.A28897E98D@FreeBSD.csie.nctu.edu.tw> <20061016011559.W61639@delplex.bde.org> <200610161431.25228.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=big5 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <200610161431.25228.jhb@freebsd.org> X-Fingerprint: E0BC 57F9 F44B 46C6 DB53 8462 F807 89F3 956E 8BC1 X-Public-Key: http://sungsung.dragon2.net/pubring.asc User-Agent: Mutt/1.5.13 (2006-08-11) Cc: freebsd-bugs@freebsd.org, FreeBSD-gnats-submit@freebsd.org, Bruce Evans , freebsd-hackers@freebsd.org, freebsd-current@freebsd.org, Cheng-Lung Sung 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: Tue, 17 Oct 2006 02:13:34 -0000 On Mon, Oct 16, 2006 at 02:31:24PM -0400, John Baldwin wrote: > On Sunday 15 October 2006 11:21, Bruce Evans wrote: > > On Sun, 15 Oct 2006, Cheng-Lung Sung wrote: > >=20 > > > System: FreeBSD.csie.nctu.edu.tw 6.1-STABLE FreeBSD 6.1-STABLE #9: Th= u May=20 > 11 14:31:45 CST 2006 =20 > 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=20 > sem_otime;" ...etc > > > - if we only compile a program which do not include sys/types.h, it w= ill=20 > fail. > >=20 > > 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). >=20 > Is this better? >=20 > Index: sem.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > 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 > =20 > + #ifndef _TIME_T_DECLARED > + typedef __time_t time_t; > + #define _TIME_T_DECLARED > + #endif > +=20 > #ifndef _PID_T_DECLARED > typedef __pid_t pid_t; > #define _PID_T_DECLARED >=20 > (it looks like pid_t should be before size_t in sem.h btw) >=20 > --=20 > John Baldwin Thanks, I didn't go through the whole sem.h. Also, it seems we should put these parts before 'sturct semid_ds'.=20 or say, after we include sys/ipc.h (which include sys/_types.h) --=20 Cheng-Lung Sung - clsung@