[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-standards
Subject:    Re: standards/96016: clock_getres et al should be in <time.h>
From:       Bruce Evans <bde () zeta ! org ! au>
Date:       2006-04-19 10:30:23
Message-ID: 200604191030.k3JAUNL1044161 () freefall ! freebsd ! org
[Download RAW message or body]

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

From: Bruce Evans <bde@zeta.org.au>
To: Robert Millan <rmh@aybabtu.com>
Cc: FreeBSD-gnats-submit@FreeBSD.org, freebsd-standards@FreeBSD.org
Subject: Re: standards/96016: clock_getres et al should be in <time.h>
Date: Wed, 19 Apr 2006 20:22:11 +1000 (EST)

 On Tue, 18 Apr 2006, Robert Millan wrote:
 
 >> Description:
 > POSIX says that the following functions should be declared in <time.h>, rather
 > than <sys/time.h>:
 >
 >  clock_getres, clock_gettime, clock_settime
 
 Er, that's why they _are_ in declared in <time.h>.  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:
 - <sys/time.h> includes <time.h> in the !_KERNEL case.  This gives lots of
    namespace pollution in <sys/time.h> 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 <sys/time.h> where they cause namespace
    pollution due to not being under any visibility ifdefs.
 - the visibility ifdefs for the declarations of the CLOCK_* ids in <time.h>
    are mostly wrong.
 - all CLOCK_* ids are declared with style bugs in <sys/time.h> and <time.h>.
 
 Duplication should be avoided by declaring the CLOCK_* ids in a little
 namespace-nonpolluting header in <sys>, but there are already too many of
 those, especially for times (there are <sys/timespec.h>, sys/<_timespec.h>
 and <_sys/_timeval.h>).
 
 Bruce
_______________________________________________
freebsd-standards@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-standards
To unsubscribe, send any mail to "freebsd-standards-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic