Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Nov 2020 08:52:58 -0700
From:      Ian Lepore <ian@freebsd.org>
To:        "freebsd-arch@FreeBSD.org" <freebsd-arch@FreeBSD.org>
Subject:   sbintime_t in userland
Message-ID:  <567389bbf8882800c86a9cd8a502051af48cc4ec.camel@freebsd.org>

next in thread | raw e-mail | index | archive | help
I notice everything related to sbintime_t in sys/time.h is in the
public part of the header file (not protected by #ifdef _KERNEL).  As
near as I can tell, no existing userland software uses this type, and
no userland<->kernel APIs involve sbintime_t.

I have a situation where I need to timestamp events relative to each
other in the kernel and report those timestamps to userland. 
sbintime_t would be an ideal compact format for the data, and
sbinuptime() would be a fine way to obtain the timestamps in the
kernel.

Before breaking new ground like this I thought I'd solicit opinions: is
it a bad idea to export sbintime_t values from the kernel like this?

If it's considered okay, a second question would be: is it okay to
document that they are on the 'uptime timescale' (meaning userland
could translate them to UTC timestamps by determining the offset
between CLOCK_REALTIME and CLOCK_MONOTONIC)?

-- Ian





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?567389bbf8882800c86a9cd8a502051af48cc4ec.camel>