From owner-freebsd-standards@FreeBSD.ORG Wed Apr 19 10:22:15 2006 Return-Path: X-Original-To: freebsd-standards@FreeBSD.org Delivered-To: freebsd-standards@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D4FC816A401; Wed, 19 Apr 2006 10:22:15 +0000 (UTC) (envelope-from bde@zeta.org.au) Received: from mailout1.pacific.net.au (mailout1.pacific.net.au [61.8.0.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id 66C6D43D49; Wed, 19 Apr 2006 10:22:15 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86]) by mailout1.pacific.net.au (Postfix) with ESMTP id C642F32FF39; Wed, 19 Apr 2006 20:22:13 +1000 (EST) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailproxy1.pacific.net.au (8.13.4/8.13.4/Debian-3sarge1) with ESMTP id k3J9j0Tl012213; Wed, 19 Apr 2006 19:45:01 +1000 Date: Wed, 19 Apr 2006 20:22:11 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Robert Millan In-Reply-To: Message-ID: <20060419192833.F72898@delplex.bde.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: FreeBSD-gnats-submit@FreeBSD.org, freebsd-standards@FreeBSD.org Subject: Re: standards/96016: clock_getres et al should be in X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Apr 2006 10:22:15 -0000 On Tue, 18 Apr 2006, Robert Millan wrote: >> Description: > POSIX says that the following functions should be declared in , rather > than : > > clock_getres, clock_gettime, clock_settime Er, that's why they _are_ in declared in . From "cvs ann src/include/time.h": % 1.24 (wollman 27-Jun-02): #if __POSIX_VISIBLE >= 199309 % 1.24 (wollman 27-Jun-02): int clock_getres(clockid_t, struct timespec *); % 1.24 (wollman 27-Jun-02): int clock_gettime(clockid_t, struct timespec *); % 1.24 (wollman 27-Jun-02): int clock_settime(clockid_t, const struct timespec *); % 1.32 (das 02-Apr-05): /* XXX missing: clock_nanosleep() */ % 1.24 (wollman 27-Jun-02): int nanosleep(const struct timespec *, struct timespec *); % 1.24 (wollman 27-Jun-02): #endif /* __POSIX_VISIBLE >= 199309 */ The main bugs in this area are: - includes in the !_KERNEL case. This gives lots of namespace pollution in including clock_getres() etc., and worse, struct tm etc. Lots of FreeBSD sources depend on this pollution. When I last tried removing this include (almost 4 years ago), there were several hundred lines of error output. - all CLOCK_* ids are declared in where they cause namespace pollution due to not being under any visibility ifdefs. - the visibility ifdefs for the declarations of the CLOCK_* ids in are mostly wrong. - all CLOCK_* ids are declared with style bugs in and . Duplication should be avoided by declaring the CLOCK_* ids in a little namespace-nonpolluting header in , but there are already too many of those, especially for times (there are , sys/<_timespec.h> and <_sys/_timeval.h>). Bruce