kern/104436: [PATCH] sys/sem.h should include sys/types.h

Cheng-Lung Sung clsung at FreeBSD.org
Tue Oct 17 17:10:19 PDT 2006


The following reply was made to PR kern/104436; it has been noted by GNATS.

From: Cheng-Lung Sung <clsung at FreeBSD.org>
To: John Baldwin <jhb at freebsd.org>
Cc: Bruce Evans <bde at zeta.org.au>, Cheng-Lung Sung <clsung at freebsd.org>,
	FreeBSD-gnats-submit at freebsd.org
Subject: Re: kern/104436: [PATCH] sys/sem.h should include sys/types.h
Date: Wed, 18 Oct 2006 08:05:26 +0800

 --4Ckj6UjgE2iN1+kY
 Content-Type: text/plain; charset=big5
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 On Tue, Oct 17, 2006 at 01:43:22PM -0400, John Baldwin wrote:
 > On Monday 16 October 2006 22:41, Bruce Evans wrote:
 > > On Tue, 17 Oct 2006, Cheng-Lung Sung wrote:
 > > >    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 need=
 ed
 > > 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...)
 >=20
 > I know Robert wants to fix that, but hasn't due to the ABI breakage that
 > would ensue.
 >=20
 > 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.
 >=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 -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 @@
 > =20
 >  #include <sys/ipc.h>
 > =20
 > +#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;
 > =20
 >  struct semid_ds {
 > @@ -100,21 +115,8 @@
 >   * Process sem_undo vectors at proc exit.
 >   */
 >  void	semexit(struct proc *p);
 > -#endif /* _KERNEL */
 > =20
 > -#ifndef _KERNEL
 > -#include <sys/cdefs.h>
 > -#include <sys/_types.h>
 > -
 > -#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 */
 > =20
 >  __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 */
 > =20
 >  #endif /* !_SYS_SEM_H_ */
 
 Thanks John, I think this solves my problem.=20
 
 --=20
 Cheng-Lung Sung - clsung@
 
 --4Ckj6UjgE2iN1+kY
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.5 (FreeBSD)
 
 iD8DBQFFNW/F+AeJ85Vui8ERAhhUAJ4/ETq/x+XKxjYVMAibv/HClQp3UwCeLaBN
 kG5pGQ0yIFe4Y7qaLDR/OVI=
 =uY5g
 -----END PGP SIGNATURE-----
 
 --4Ckj6UjgE2iN1+kY--


More information about the freebsd-bugs mailing list