History log of /netbsd-src/include/time.h (Results 1 – 25 of 53)
Revision Date Author Comments
# 62e8705b 16-Sep-2024 kre <kre@NetBSD.org>

The prototype for localtime_r needs to be inside the
#ifndef __LIBC12_SOURCE__ block, as it has a time_t
parameter, and the compat code needs to be able to
make that 32 bits instead of 64.


# c6988756 16-Sep-2024 christos <christos@NetBSD.org>

move gmtime_r in the right ifdefs block, it was not removed in 202405.


# a3e46970 16-Sep-2024 christos <christos@NetBSD.org>

asctime_r and ctime_r are no more for POSIX202405


# 4549ddae 08-Sep-2024 rillig <rillig@NetBSD.org>

include: C11 has been released


# 662b4a85 19-Aug-2023 rillig <rillig@NetBSD.org>

time.h: fix typo in comment


# db130853 23-Oct-2022 jschauma <jschauma@NetBSD.org>

correct tm_sec range to be [0-60]

The previous range introduced in time.h rev1.14 was supposed to account
for a mystical "double leap second", which ultimately never could exist
and was a mistaken i

correct tm_sec range to be [0-60]

The previous range introduced in time.h rev1.14 was supposed to account
for a mystical "double leap second", which ultimately never could exist
and was a mistaken interpretation from an early ISO C standard whereby
the possibility of two leap seconds within a year was erroneously
interpreted to mean that two leap seconds could occur at once.

show more ...


# 7f4b5eb1 04-Oct-2016 kamil <kamil@NetBSD.org>

Add timespec_get(3) in <time.h> and enable unconditionally struct timespec

These changes conforms to the C11 standard
References:
- 7.27.1/3 Components of time (struct timespec)
- 7.27.2.5 The tim

Add timespec_get(3) in <time.h> and enable unconditionally struct timespec

These changes conforms to the C11 standard
References:
- 7.27.1/3 Components of time (struct timespec)
- 7.27.2.5 The timespec_get function

According to ISO/IEC 9899:201x (draft) <time.h> defines the timespec
structure and declares the timespec_get(3) function with TIME_UTC
definition.

According to a C++17 standard draft <ctime> offers the same interface in
the std:: namespace.

The timespec_get function modifies the timespec object pointed by ts
to hold the current calendar time in the given base. The standard notes
only the TIME_UTC base with implementation defined value, set it to 1
as zero is reserved for error handling. Once operation was successful this
function returns passed base, otherwise exits with zero.

The timespec struct was already part of the POSIX standard in <time.h>.

Enable this interface unconditionally in the header to allow to use it
in a code prior C11 and C++17 as an extension.

Review notes from <christos>

show more ...


# ac892fb5 23-Apr-2016 christos <christos@NetBSD.org>

add clock_cpugetclockid{2,}


# 1136c97c 29-Oct-2015 christos <christos@NetBSD.org>

add tzgetgmtoff


# 3a0f0eb6 07-Oct-2014 christos <christos@NetBSD.org>

sync function signatures with tzcode


# e91cf890 21-Apr-2013 joerg <joerg@NetBSD.org>

strftime_l is part of POSIX2008.


# 99fac95b 21-Apr-2013 joerg <joerg@NetBSD.org>

Store time-specific locale data directly in the locale.
Ad dstrftime_l, strftime_lz and strptime_l.


# 71bbc999 02-Oct-2012 christos <christos@NetBSD.org>

add clock_nanosleep


# 5a87b22e 16-Dec-2010 christos <christos@NetBSD.org>

Provide a re-entrant and thread-safe set of timezone API's that
don't require locking and can operate on user-specified timezones
as opposed to having to alter the environment to change a timezone.
T

Provide a re-entrant and thread-safe set of timezone API's that
don't require locking and can operate on user-specified timezones
as opposed to having to alter the environment to change a timezone.
This work was presented to the tzcode folks and it was generally
accepted, but there seems to be a lot of inertia.

show more ...


# c8da0e5f 14-May-2009 ginsbach <ginsbach@NetBSD.org>

Add the getdate(3) function and getdate_err value, conforming to IEEE
Std 1003.1 (``POSIX.1'') and the Open Group Base Specifications X/Open
System Interfaces extension (``XSI'').


# 50728e78 11-Jan-2009 christos <christos@NetBSD.org>

merge christos-time_t


# 9fa41d73 21-Sep-2008 christos <christos@NetBSD.org>

add missing attributes to the remaining calls, even the ones that gcc has
builtin attributes for (for symmetry and consistency). In the future this
might change to use compiler-neutral macros. On the

add missing attributes to the remaining calls, even the ones that gcc has
builtin attributes for (for symmetry and consistency). In the future this
might change to use compiler-neutral macros. On the other hand I don't
know of any other compiler that provides other macros with similar
functionality, so why bother?

show more ...


# 7cc98087 01-Apr-2008 drochner <drochner@NetBSD.org>

everyone else assumes that defining "_XOPEN_SOURCE" means XPG4.2,
so remove comparisions against the numerical values "3" or "4"


# 66412e72 13-Sep-2005 christos <christos@NetBSD.org>

compat code reorg


# 19b7469a 03-Feb-2005 perry <perry@NetBSD.org>

de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.


# 413b3367 21-Dec-2003 kleink <kleink@NetBSD.org>

Do a little const cleanup, for consistency with std interfaces.


# 9865e7ff 13-Sep-2003 kleink <kleink@NetBSD.org>

Sprinkle restrict into timer_{create,settime}(2).


# 039cc956 07-Aug-2003 agc <agc@NetBSD.org>

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22270, verified by myself.


# 4be7a2dc 28-Apr-2003 bjh21 <bjh21@NetBSD.org>

Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.

Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.

show more ...


# c1ba727b 30-Jun-2002 bjh21 <bjh21@NetBSD.org>

Version times() so that programs compiled before the recent change to make
sysconf(_SC_CLK_TCK) return hz will work.

In detail:
__times13() returns values scaled by hz.
times() returns values scaled

Version times() so that programs compiled before the recent change to make
sysconf(_SC_CLK_TCK) return hz will work.

In detail:
__times13() returns values scaled by hz.
times() returns values scaled by 100.
<sys/times.h> renames times() to __times13().

_SC_CLK_TCK has changed from 3 to 39.
sysconf(3) returns 100.
sysconf(39) returns hz.
CLK_TCK is defined as sysconf(39).

show more ...


123