This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Defining timespec in time.h or sys/time.h?
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Steve Ellcey <sellcey at cavium dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Wed, 18 Oct 2017 23:27:54 +0000
- Subject: Re: Defining timespec in time.h or sys/time.h?
- Authentication-results: sourceware.org; auth=none
- References: <1508361378.9295.10.camel@cavium.com>
On Wed, 18 Oct 2017, Steve Ellcey wrote:
> It looks like the older sys/time.h would include time.h but the current one
> doesn't. Is this change intentional? I am guessing it is. Does the ISO C11
> standard says that you need to include time.h and not sys/time.h to get
> the timespec structure? I don't have a copy of the standard but that would
> seem to be the implication of this code in the current time.h:
There is no such header as sys/time.h (or indeed sys/anything.h) in ISO C.
There is also no such header in base POSIX; sys/time.h is XSI only.
sys/time.h is permitted to include sys/select.h which is permitted to
include time.h, but there is no requirement for it to do so.
--
Joseph S. Myers
joseph@codesourcery.com