History log of /openbsd-current/sys/sys/_time.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.10 25-Oct-2022 millert

Move CLOCKS_PER_SEC to sys/_time.h so the kernel has access to it.
This will be used in waitid(2) to set si_utime and si_stime.
The definition of struct timespec also moves from time.h to sys/_time.h
for struct itimerspec. OK kettenis@


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE OPENBSD_7_1_BASE OPENBSD_7_2_BASE
# 1.9 18-Dec-2017 cheloha

Add the CLOCK_BOOTTIME clockid for use with clock_gettime(2)
and put it to use in userspace in lieu of the kern.boottime
sysctl.

Its absolute value is the time that has elapsed since the
system booted, i.e., the system uptime.

Use in top(1), w(1), and snmpd(8) eliminates a race with
settimeofday(2), adjtime(2), etc. inherent to deriving the
system uptime via the kern.boottime sysctl.

Product of a great deal of discussion/revision with jca@, tb@,
and guenther@.

ok tb@ jca@ guenther@ dlg@ mlarkin@ tom@


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.8 03-Sep-2016 akfaew

Remove ticket lock support from thrsleep. It's unused.

OK guenther@ mpi@ tedu@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.7 16-Oct-2014 millert

Remove references to unimplemented CLOCK_VIRTUAL. It is non-standard
and existing implementations vary as to whether it returns time for
the calling thread or the entire process. OK kettenis@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.6 06-Oct-2013 guenther

Add CLOCK_UPTIME, a clock which measures time-running-not-suspended, so
that mlarkin@ can fix programs that report rates-over-uptime.

ok kettenis@
manpage corrections jmc@ (which I've probably broken again)


# 1.5 14-Sep-2013 guenther

Snapshots for all archs have been built, so remove the T32 code


# 1.4 13-Aug-2013 guenther

Switch time_t, ino_t, clock_t, and struct kevent's ident and data
members to 64bit types. Assign new syscall numbers for (almost
all) the syscalls that involve the affected types, including anything
with time_t, timeval, itimerval, timespec, rusage, dirent, stat,
or kevent arguments. Add a d_off member to struct dirent and replace
getdirentries() with getdents(), thus immensely simplifying and
accelerating telldir/seekdir. Build perl with -DBIG_TIME.

Bump the major on every single base library: the compat bits included
here are only good enough to make the transition; the T32 compat
option will be burned as soon as we've reached the new world are
are happy with the snapshots for all architectures.

DANGER: ABI incompatibility. Updating to this kernel requires extra
work or you won't be able to login: install a snapshot instead.

Much assistance in fixing userland issues from deraadt@ and tedu@
and build assistance from todd@ and otto@


Revision tags: OPENBSD_5_4_BASE
# 1.3 17-Jun-2013 guenther

Add support for the _POSIX_CPUTIME and _POSIX_THREAD_CPUTIME options,
including CLOCK_{PROCESS,THREAD}_CPUTIME_ID constants and
{clock,pthread}_getcpuclockid() functions.

Worked out at t2k13 with help from tedu@ and matthew@ and testing by aja@
ok matthew@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.2 10-May-2012 kettenis

Recongnize that:

* strptime(3) was introduced in XPG 4.0
* clock_gettime(3) and friends were introduced in 1003.1b-1993
* asctime_r(3) and friends were introduced in 1003.1c-1995

and conditionally provide prototypes and associated types accordingly.
This makes our <time.h> standards compliant except for some functions that are
still missing.

ok guenther@


# 1.1 07-May-2012 kettenis

Once more the people behind POSIX didn't think and put clock_gettime(2) and
friends in <time.h>. The kernel needs access to the associated #defines, but
can't get them from <time.h>, so introduce a new header <sys/_time.h> and
include that from <time.h> for userland and <sys/time.h> for the kernel.

ok matthew@, guenther@, millert@


# 1.9 18-Dec-2017 cheloha

Add the CLOCK_BOOTTIME clockid for use with clock_gettime(2)
and put it to use in userspace in lieu of the kern.boottime
sysctl.

Its absolute value is the time that has elapsed since the
system booted, i.e., the system uptime.

Use in top(1), w(1), and snmpd(8) eliminates a race with
settimeofday(2), adjtime(2), etc. inherent to deriving the
system uptime via the kern.boottime sysctl.

Product of a great deal of discussion/revision with jca@, tb@,
and guenther@.

ok tb@ jca@ guenther@ dlg@ mlarkin@ tom@


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.8 03-Sep-2016 akfaew

Remove ticket lock support from thrsleep. It's unused.

OK guenther@ mpi@ tedu@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.7 16-Oct-2014 millert

Remove references to unimplemented CLOCK_VIRTUAL. It is non-standard
and existing implementations vary as to whether it returns time for
the calling thread or the entire process. OK kettenis@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.6 06-Oct-2013 guenther

Add CLOCK_UPTIME, a clock which measures time-running-not-suspended, so
that mlarkin@ can fix programs that report rates-over-uptime.

ok kettenis@
manpage corrections jmc@ (which I've probably broken again)


# 1.5 14-Sep-2013 guenther

Snapshots for all archs have been built, so remove the T32 code


# 1.4 13-Aug-2013 guenther

Switch time_t, ino_t, clock_t, and struct kevent's ident and data
members to 64bit types. Assign new syscall numbers for (almost
all) the syscalls that involve the affected types, including anything
with time_t, timeval, itimerval, timespec, rusage, dirent, stat,
or kevent arguments. Add a d_off member to struct dirent and replace
getdirentries() with getdents(), thus immensely simplifying and
accelerating telldir/seekdir. Build perl with -DBIG_TIME.

Bump the major on every single base library: the compat bits included
here are only good enough to make the transition; the T32 compat
option will be burned as soon as we've reached the new world are
are happy with the snapshots for all architectures.

DANGER: ABI incompatibility. Updating to this kernel requires extra
work or you won't be able to login: install a snapshot instead.

Much assistance in fixing userland issues from deraadt@ and tedu@
and build assistance from todd@ and otto@


Revision tags: OPENBSD_5_4_BASE
# 1.3 17-Jun-2013 guenther

Add support for the _POSIX_CPUTIME and _POSIX_THREAD_CPUTIME options,
including CLOCK_{PROCESS,THREAD}_CPUTIME_ID constants and
{clock,pthread}_getcpuclockid() functions.

Worked out at t2k13 with help from tedu@ and matthew@ and testing by aja@
ok matthew@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.2 10-May-2012 kettenis

Recongnize that:

* strptime(3) was introduced in XPG 4.0
* clock_gettime(3) and friends were introduced in 1003.1b-1993
* asctime_r(3) and friends were introduced in 1003.1c-1995

and conditionally provide prototypes and associated types accordingly.
This makes our <time.h> standards compliant except for some functions that are
still missing.

ok guenther@


# 1.1 07-May-2012 kettenis

Once more the people behind POSIX didn't think and put clock_gettime(2) and
friends in <time.h>. The kernel needs access to the associated #defines, but
can't get them from <time.h>, so introduce a new header <sys/_time.h> and
include that from <time.h> for userland and <sys/time.h> for the kernel.

ok matthew@, guenther@, millert@