Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Oct 2006 11:39:09 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-hackers@freebsd.org, freebsd-bugs@freebsd.org, Cheng-Lung Sung <clsung@freebsd.org>, FreeBSD-gnats-submit@freebsd.org, freebsd-current@freebsd.org
Subject:   Re: kern/104436: [PATCH] sys/sem.h should include sys/types.h
Message-ID:  <20061017113234.V67620@delplex.bde.org>
In-Reply-To: <200610161431.25228.jhb@freebsd.org>
References:  <20061015135710.A28897E98D@FreeBSD.csie.nctu.edu.tw> <20061016011559.W61639@delplex.bde.org> <200610161431.25228.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
[This is still being sent to too many mailing lists since I don't know
  which ones it should go to except gnats.]

On Mon, 16 Oct 2006, John Baldwin wrote:

>> 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)

Good.  (I didn't check if there are any other missing typedefs.)
Please commit.

The old typedefs also have non-KNF whitespace.  sys/ipc.h is better.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061017113234.V67620>