From rmh@io.debian.net Tue Apr 18 17:40:24 2006 Return-Path: Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E11AD16A413 for ; Tue, 18 Apr 2006 17:40:24 +0000 (UTC) (envelope-from rmh@io.debian.net) Received: from io.debian.net (io.ethz.ch [129.132.80.17]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1F26143D72 for ; Tue, 18 Apr 2006 17:40:24 +0000 (GMT) (envelope-from rmh@io.debian.net) Received: from rmh by io.debian.net with local (Exim 4.61) (envelope-from ) id 1FVuBa-000Et7-KJ for FreeBSD-gnats-submit@freebsd.org; Tue, 18 Apr 2006 19:40:22 +0200 Message-Id: Date: Tue, 18 Apr 2006 19:40:22 +0200 From: Robert Millan Reply-To: Robert Millan To: FreeBSD-gnats-submit@freebsd.org Cc: Subject: clock_getres et al should be in X-Send-Pr-Version: 3.113 X-GNATS-Notify: >Number: 96016 >Category: standards >Synopsis: [headers] clock_getres et al should be in >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-standards >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Apr 18 17:50:12 GMT 2006 >Closed-Date: Sat Jan 29 20:46:17 UTC 2011 >Last-Modified: Sat Jan 29 20:46:17 UTC 2011 >Originator: Robert Millan >Release: GNU/kFreeBSD 5.4-1-586 i586 >Organization: >Environment: System: GNU/kFreeBSD io.debian.net 5.4-1-586 #0 Mon Dec 5 19:45:10 CET 2005 i586 i386 AMD-K6(tm) 3D processor GNU/kFreeBSD Architecture: i586 >Description: POSIX says that the following functions should be declared in , rather than : clock_getres, clock_gettime, clock_settime See http://www.opengroup.org/onlinepubs/009695399/functions/clock_settime.html >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: From: Bruce Evans To: Robert Millan Cc: FreeBSD-gnats-submit@FreeBSD.org, freebsd-standards@FreeBSD.org Subject: Re: standards/96016: clock_getres et al should be in Date: Wed, 19 Apr 2006 20:22:11 +1000 (EST) On Tue, 18 Apr 2006, Robert Millan wrote: 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 From: Garrett Cooper To: bug-followup@FreeBSD.org, rmh@aybabtu.com Cc: Subject: Re: standards/96016: [headers] clock_getres et al should be in <time.h> Date: Sat, 29 Jan 2011 11:57:21 -0800 clock_getres, et all are declared in time.h, not sys/time.h, so this item can be closed. I have started work to cleanup the pollution created with sys/time.h including time.h in http://p4db.freebsd.org/depotTreeBrowser.cgi?FSPC=//depot/user/gcooper/posix-conformance-work as brde noted in the previous reply, but that's outside the problem definition for this bug. Thanks, -Garrett State-Changed-From-To: open->closed State-Changed-By: jilles State-Changed-When: Sat Jan 29 20:46:16 UTC 2011 State-Changed-Why: clock_getres et al are defined in . including is a separate problem. http://www.freebsd.org/cgi/query-pr.cgi?pr=96016 >Unformatted: