Page MenuHomeFreeBSD

D57931.id180887.diff
No OneTemporary

D57931.id180887.diff

diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -320,6 +320,7 @@
rtentry.9 \
runqueue.9 \
rwlock.9 \
+ sbintime.9 \
sbuf.9 \
scheduler.9 \
SDT.9 \
@@ -1985,6 +1986,19 @@
rwlock.9 rw_wlock.9 \
rwlock.9 rw_wowned.9 \
rwlock.9 rw_wunlock.9
+MLINKS+=sbintime.9 bttosbt.9 \
+ sbintime.9 mstosbt.9 \
+ sbintime.9 nstosbt.9 \
+ sbintime.9 sbintime_getsec.9 \
+ sbintime.9 sbttobt.9 \
+ sbintime.9 sbttoms.9 \
+ sbintime.9 sbttons.9 \
+ sbintime.9 sbttots.9 \
+ sbintime.9 sbttotv.9 \
+ sbintime.9 sbttous.9 \
+ sbintime.9 tstosbt.9 \
+ sbintime.9 tvtosbt.9 \
+ sbintime.9 ustosbt.9
MLINKS+=sbuf.9 sbuf_bcat.9 \
sbuf.9 sbuf_bcopyin.9 \
sbuf.9 sbuf_bcpy.9 \
diff --git a/share/man/man9/sbintime.9 b/share/man/man9/sbintime.9
new file mode 100644
--- /dev/null
+++ b/share/man/man9/sbintime.9
@@ -0,0 +1,177 @@
+.\"-
+.\" Copyright (c) 2026 Ka Ho Ng
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.Dd June 28, 2026
+.Dt SBINTIME 9
+.Os
+.Sh NAME
+.Nm sbintime_t ,
+.Nm sbintime_getsec ,
+.Nm bttosbt ,
+.Nm sbttobt ,
+.Nm sbttons ,
+.Nm nstosbt ,
+.Nm sbttous ,
+.Nm ustosbt ,
+.Nm sbttoms ,
+.Nm mstosbt ,
+.Nm sbttots ,
+.Nm tstosbt ,
+.Nm sbttotv ,
+.Nm tvtosbt
+.Nd Q32.32 fixed point representation of time
+.Sh SYNOPSIS
+.In sys/types.h
+.In sys/time.h
+.Vt typedef __int64_t __sbintime_t ;
+.Vt typedef __sbintime_t sbintime_t ;
+.Ft int
+.Fn sbintime_getsec "sbintime_t _sbt"
+.Ft sbintime_t
+.Fn bttosbt "const struct bintime *_bt"
+.Ft struct bintime
+.Fn sbttobt "sbintime_t _sbt"
+.Ft int64_t
+.Fn sbttons "sbintime_t sbt"
+.Ft sbintime_t
+.Fn nstosbt "int64_t ns"
+.Ft int64_t
+.Fn sbttous "sbintime_t sbt"
+.Ft sbintime_t
+.Fn ustosbt "int64_t us"
+.Ft int64_t
+.Fn sbttoms "sbintime_t sbt"
+.Ft sbintime_t
+.Fn mstosbt "int64_t ms"
+.Ft struct timespec
+.Fn sbttots "sbintime_t _sbt"
+.Ft sbintime_t
+.Fn tstosbt "struct timespec _ts"
+.Ft struct timeval
+.Fn sbttotv "sbintime_t _sbt"
+.Ft sbintime_t
+.Fn tvtosbt "struct timeval _tv"
+.Sh DESCRIPTION
+The
+.Vt sbintime_t
+type is a Q32.32 fixed point representation of time.
+The high 32-bit integral bits specify the number of seconds,
+and the low 32-bit fractional bits specify the sub-second portion.
+.\" Begin of helper functions subsection
+.Bl -tag -width indent
+.It Fn sbintime_getsec _sbt
+Returns the number of seconds from an
+.Vt sbintime_t
+specified by the
+.Fa _sbt
+argument.
+.It Fn bttosbt _bt
+Converts a
+.Vt struct bintime
+specified by the
+.Fa _bt
+argument to an
+.Vt sbintime_t .
+.It Fn sbttobt _bt
+Converts an
+.Vt sbintime_t
+specified by the
+.Fa _sbt
+argument to a
+.Vt "struct bintime" .
+.It Fn sbttons sbt
+Converts
+.Vt sbintime_t
+specified by the
+.Fa sbt
+argument to the number of nanoseconds.
+.It Fn nstosbt ns
+Converts the number of nanoseconds specified by the
+.Fa ns
+argument to an
+.Vt sbintime_t .
+.It Fn sbttous sbt
+Converts an
+.Vt sbintime_t
+specified by the
+.Fa sbt
+argument to the number of microseconds.
+.It Fn ustosbt us
+Converts the number of microseconds specified by the
+.Fa us
+argument to an
+.Vt sbintime_t .
+.It Fn sbttoms sbt
+Converts an
+.Vt sbintime_t
+specified by the
+.Fa sbt
+argument to the number of milliseconds.
+.It Fn mstosbt ms
+Converts the number of milliseconds specified by the
+.Fa ms
+argument to an
+.Vt sbintime_t .
+.It Fn sbttots _sbt
+Converts an
+.Vt sbintime_t
+specified by the
+.Fa _sbt
+argument to a
+.Vt "struct timespec" .
+.It Fn tstosbt _ts
+Converts a
+.Vt "struct timespec"
+specified by the
+.Fa _ts
+argument to an
+.Vt sbintime_t .
+.It Fn sbttotv _sbt
+Converts an
+.Vt sbintime_t
+specified by the
+.Fa _sbt
+argument to a
+.Vt "struct timeval" .
+.It Fn tvtosbt _tv
+Converts a
+.Vt "struct timeval"
+specified by the
+.Fa _tv
+argument to an
+.Vt sbintime_t .
+.El
+.\" End of helper functions subsection
+.Sh SEE ALSO
+.Xr bintime 9 ,
+.Xr callout 9 ,
+.Xr tvtohz 9
+.Sh HISTORY
+The
+.Nm sbintime_t
+type and the helper functions first appeared in
+.Fx 10.0 .
+.Sh AUTHORS
+This manual page was written by
+.An Ka Ho Ng Aq Mt khng@FreeBSD.org .

File Metadata

Mime Type
text/plain
Expires
Thu, Jul 2, 10:35 AM (2 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34593646
Default Alt Text
D57931.id180887.diff (5 KB)

Event Timeline