From owner-freebsd-bugs@FreeBSD.ORG Tue Oct 17 17:50:29 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AA18116A415 for ; Tue, 17 Oct 2006 17:50:29 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 586A743D6E for ; Tue, 17 Oct 2006 17:50:24 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k9HHoNUk099194 for ; Tue, 17 Oct 2006 17:50:23 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k9HHoN52099193; Tue, 17 Oct 2006 17:50:23 GMT (envelope-from gnats) Date: Tue, 17 Oct 2006 17:50:23 GMT Message-Id: <200610171750.k9HHoN52099193@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: John Baldwin Cc: Subject: Re: kern/104436: [PATCH] sys/sem.h should include sys/types.h X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John Baldwin List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2006 17:50:29 -0000 The following reply was made to PR kern/104436; it has been noted by GNATS. From: John Baldwin To: Bruce Evans Cc: Cheng-Lung Sung , FreeBSD-gnats-submit@freebsd.org Subject: Re: kern/104436: [PATCH] sys/sem.h should include sys/types.h Date: Tue, 17 Oct 2006 13:43:22 -0400 On Monday 16 October 2006 22:41, Bruce Evans wrote: > On Tue, 17 Oct 2006, Cheng-Lung Sung wrote: > > > On Mon, Oct 16, 2006 at 02:31:24PM -0400, John Baldwin wrote: > >> Is this better? > >> ... > > Thanks, I didn't go through the whole sem.h. > > Also, it seems we should put these parts before 'sturct semid_ds'. > > or say, after we include sys/ipc.h (which include sys/_types.h) > > Yes, that is especially needed for time_t, since it is the only one of > the typedef'ed types used early in sys/sem.h. The others might be needed > later when the non-typedefed types are cleaned up. (sys/ipc.h needs > cleaning up more. It still spells uid_t as "unsigned short", but uids > aren't that short...) I know Robert wants to fix that, but hasn't due to the ABI breakage that would ensue. How's this, it removes extra includes of cdefs.h and _types.h (ipc.h already includes them), moves the typedefs earlier and includes them in the _KERNEL case (consistent with ipc.h) and fixes the whitespace in the typedefs. Index: sem.h =================================================================== RCS file: /usr/cvs/src/sys/sys/sem.h,v retrieving revision 1.29 diff -u -r1.29 sem.h --- sem.h 17 Nov 2004 13:12:06 -0000 1.29 +++ sem.h 17 Oct 2006 17:41:20 -0000 @@ -12,6 +12,21 @@ #include +#ifndef _PID_T_DECLARED +typedef __pid_t pid_t; +#define _PID_T_DECLARED +#endif + +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED +#endif + +#ifndef _TIME_T_DECLARED +typedef __time_t time_t; +#define _TIME_T_DECLARED +#endif + struct sem; struct semid_ds { @@ -100,21 +115,8 @@ * Process sem_undo vectors at proc exit. */ void semexit(struct proc *p); -#endif /* _KERNEL */ -#ifndef _KERNEL -#include -#include - -#ifndef _SIZE_T_DECLARED -typedef __size_t size_t; -#define _SIZE_T_DECLARED -#endif - -#ifndef _PID_T_DECLARED -typedef __pid_t pid_t; -#define _PID_T_DECLARED -#endif +#else /* ! _KERNEL */ __BEGIN_DECLS int semsys(int, ...); @@ -122,6 +124,7 @@ int semget(key_t, int, int); int semop(int, struct sembuf *, size_t); __END_DECLS + #endif /* !_KERNEL */ #endif /* !_SYS_SEM_H_ */ -- John Baldwin