~nabijaczleweli/voreutils

58932cecd7b0d91af0436de15456a6e875a968b9 — наб autouploader a month ago 4ff2e70
Manpage update by job 786675
98 files changed, 4788 insertions(+), 884 deletions(-)

M man1/base64.1
M man1/base64.1.html
M man1/basename.1
M man1/basename.1.html
M man1/cat.1
M man1/cat.1.html
M man1/chown.1
M man1/chown.1.html
M man1/cut.1
M man1/cut.1.html
M man1/dd.1
M man1/dd.1.html
M man1/df.1
M man1/df.1.html
M man1/echo.1
M man1/echo.1.html
M man1/env.1
M man1/env.1.html
M man1/expand.1
M man1/expand.1.html
M man1/expr.1
M man1/expr.1.html
M man1/factor.1.html
M man1/head.1
M man1/head.1.html
M man1/hostid.1
M man1/hostid.1.html
M man1/id.1
M man1/id.1.html
M man1/link.1
M man1/link.1.html
M man1/logname.1
M man1/logname.1.html
A man1/machine.1
A man1/machine.1.html
M man1/mkfifo.1
M man1/mkfifo.1.html
M man1/mktemp.1
M man1/mktemp.1.html
M man1/nice.1
M man1/nice.1.html
M man1/nohup.1
M man1/nohup.1.html
M man1/paste.1
M man1/paste.1.html
M man1/pathchk.1
M man1/pathchk.1.html
M man1/printenv.1
M man1/printenv.1.html
M man1/printf.1
M man1/printf.1.html
M man1/pwd.1
M man1/pwd.1.html
M man1/rm.1
M man1/rm.1.html
M man1/sha1sum.1
M man1/sha1sum.1.html
M man1/shred.1
M man1/shred.1.html
M man1/shuf.1
M man1/shuf.1.html
M man1/sleep.1
M man1/sleep.1.html
M man1/stdbuf.1
M man1/stdbuf.1.html
M man1/sum.1
M man1/sum.1.html
M man1/sync.1
M man1/sync.1.html
M man1/tac.1
M man1/tac.1.html
M man1/tee.1
M man1/tee.1.html
M man1/test.1
M man1/test.1.html
M man1/timeout.1
M man1/timeout.1.html
M man1/tr.1
M man1/tr.1.html
M man1/truncate.1
M man1/truncate.1.html
M man1/tsort.1
M man1/tsort.1.html
M man1/tty.1
M man1/tty.1.html
M man1/uname.1
M man1/uname.1.html
M man1/unlink.1
M man1/unlink.1.html
M man1/wc.1
M man1/wc.1.html
M man1/yes.1
M man1/yes.1.html
M man3/libstdbuf.3
M man3/libstdbuf.3.html
M man8/chroot.8
M man8/chroot.8.html
M style.css
M man1/base64.1 => man1/base64.1 +3 -3
@@ 1,7 1,7 @@
'\" e
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 30, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt BASE64 1
.Os voreutils pre-v0.0.0-latest


@@ 147,7 147,7 @@ wasn't set.
.Lk http://tools.ietf.org/html/4648 "RFC 4648"
.
.Sh HISTORY
This implementation is fully compatible with the GNU system, which contains
Compatible with the GNU system, which contains
.Nm
and
.Nm base32


@@ 157,7 157,7 @@ A compatible
also appears in
.Nx 9.0 .
.Pp
.Bx 4.0
.Bx 4
introduced
.Xr uuencode 1C
.Pq and Xr uudecode 1C :

M man1/base64.1.html => man1/base64.1.html +5 -5
@@ 189,11 189,11 @@ is not an integer), it's padded with null bytes, expressed as
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">This implementation is fully compatible with the GNU system, which
    contains <code class="Nm">base64</code> and <code class="Nm">base32</code>
    only. A compatible <code class="Nm">base64</code> also appears in
<p class="Pp">Compatible with the GNU system, which contains
    <code class="Nm">base64</code> and <code class="Nm">base32</code> only. A
    compatible <code class="Nm">base64</code> also appears in
    <span class="Ux">NetBSD 9.0</span>.</p>
<p class="Pp"><span class="Ux">4.0BSD</span> introduced
<p class="Pp"><span class="Ux">4BSD</span> introduced
    <a class="Xr" href="https://manpages.debian.org/bullseye/uuencode.1C">uuencode(1C)</a>
    (and
    <a class="Xr" href="https://manpages.debian.org/bullseye/uudecode.1C">uudecode(1C)</a>):


@@ 208,7 208,7 @@ is not an integer), it's padded with null bytes, expressed as
</div>
<table class="foot">
  <tr>
    <td class="foot-date">December 30, 2021</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/basename.1 => man1/basename.1 +2 -2
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 30, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt BASENAME 1
.Os voreutils pre-v0.0.0-latest


@@ 104,7 104,7 @@ appeared, fully formed, save for lacking a newline at the end, in
.At v7 ,
as
.Xr basename 1 :
.D1 Sy basename No "string [ suffix ]"
.D1 "\fBbasename\fP string [ suffix ]"
.Pp
.Tn CB-UNIX
at or before 2.1 contains unrelated shell implementations (newline included) of both.

M man1/basename.1.html => man1/basename.1.html +2 -4
@@ 130,9 130,7 @@ dir2
    lacking a newline at the end, in <span class="Ux">Version&#x00A0;7 AT&amp;T
    UNIX</span>, as
    <a class="Xr" href="../man1/basename.1.html">basename(1)</a>:</p>
<div class="Bd
  Bd-indent"><a class="permalink" href="#basename"><b class="Sy" id="basename">basename</b></a>
  <span class="No">string [ suffix ]</span></div>
<div class="Bd Bd-indent"><b>basename</b> string [ suffix ]</div>
<p class="Pp">CB-UNIX at or before 2.1 contains unrelated shell implementations
    (newline included) of both. CB-UNIX was, among others, the basis for
    <span class="Ux">AT&amp;T System&#x00A0;III UNIX</span>, where it first saw


@@ 149,7 147,7 @@ dir2
</div>
<table class="foot">
  <tr>
    <td class="foot-date">December 30, 2021</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/cat.1 => man1/cat.1 +7 -5
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd January 23, 2022
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt CAT 1
.Os voreutils pre-v0.0.0-latest


@@ 48,14 48,16 @@ Replace tab characters with
Prepend newlines with a dollar
.Pq Qq Cm $ .
.It Fl v , -show-nonprinting
Replace non-printable ASCII characters
Replace non-printable
.Tn ASCII
characters
.Pq Bo Em 0 , 0x1F Bc \[cu] Bo Em 0x7F , 0xFF Bc \- Brq Em 0x09 Po tab Pc , Em 0x0A Pq newline
with their corresponding
.Qq Cm \(ha Ns Ar c
and
.Qq Cm M- Ns Ar c
escapes
.Pq see Sx "Escapes" .
.Pq see Sx STANDARDS , Escapes .
.
.It Fl t
.Fl \&Tv


@@ 174,7 176,7 @@ until end-of-file, this is a significant penalty, but is, regardless, most likel
.Xr read II Ns s
onto
.Xr write II Ns s ) .
It also explicitly checks for, skips, and warns about, one of the input files also being bound to the standard output stream.
It also explicitly checks for, skips, and warns about one of the input files also being bound to the standard output stream.
.Pp
.Bx 3
uses a larger,


@@ 192,7 194,7 @@ sees a fast
.Xr read 2 Ns / Ns Xr write 2
path if no flags were specified.
.Pp
.Tn PWB/UNIX ,
.No Programmer's Workbench Pq Tn PWB/UNIX ,
instead, sees
.Fl s ,
silencing errors, and a re-write in terms of

M man1/cat.1.html => man1/cat.1.html +7 -5
@@ 82,6 82,7 @@
      (newline)}) with their corresponding
      &quot;<code class="Cm">^</code><var class="Ar">c</var>&quot; and
      &quot;<code class="Cm">M-</code><var class="Ar">c</var>&quot; escapes (see
      <a class="Sx" href="#STANDARDS">STANDARDS</a>,
      <a class="Sx" href="#Escapes">Escapes</a>).</dd>
  <dt id="t"><a class="permalink" href="#t"><code class="Fl">-t</code></a></dt>
  <dd><a class="permalink" href="#Tv"><code class="Fl" id="Tv">-Tv</code></a></dd>


@@ 271,8 272,8 @@ With the standard input stream used if no <var class="Ar">file</var>s, as today.
    <a class="Xr" href="https://manpages.debian.org/bullseye/read.II">read(II)</a>s
    onto
    <a class="Xr" href="https://manpages.debian.org/bullseye/write.II">write(II)</a>s).
    It also explicitly checks for, skips, and warns about, one of the input
    files also being bound to the standard output stream.</p>
    It also explicitly checks for, skips, and warns about one of the input files
    also being bound to the standard output stream.</p>
<p class="Pp" id="1024"><span class="Ux">3BSD</span> uses a larger,
    <a class="permalink" href="#1024"><i class="Em">1024</i></a>-byte
    <code class="Dv">BUFSIZ</code>, and hence output buffer.</p>


@@ 283,8 284,9 @@ With the standard input stream used if no <var class="Ar">file</var>s, as today.
<p class="Pp"><span class="Ux">4.3BSD</span> sees a fast
    <a class="Xr" href="https://manpages.debian.org/bullseye/read.2">read(2)</a>/<a class="Xr" href="https://manpages.debian.org/bullseye/write.2">write(2)</a>
    path if no flags were specified.</p>
<p class="Pp">PWB/UNIX, instead, sees <code class="Fl">-s</code>, silencing
    errors, and a re-write in terms of
<p class="Pp"><span class="No">Programmer's Workbench</span> (PWB/UNIX),
    instead, sees <code class="Fl">-s</code>, silencing errors, and a re-write
    in terms of
    <a class="Xr" href="https://manpages.debian.org/bullseye/read.2">read(2)</a>/<a class="Xr" href="https://manpages.debian.org/bullseye/write.2">write(2)</a>.
    Oddly, <span class="Ux">AT&amp;T System&#x00A0;III UNIX</span> inherits this
    <code class="Fl">-s</code> into an <span class="Ux">Version&#x00A0;7


@@ 305,7 307,7 @@ With the standard input stream used if no <var class="Ar">file</var>s, as today.
</div>
<table class="foot">
  <tr>
    <td class="foot-date">January 23, 2022</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/chown.1 => man1/chown.1 +7 -4
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 30, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt CHOWN 1
.Os voreutils pre-v0.0.0-latest


@@ 200,7 200,7 @@ is also present in
.Nx 7.0 .
.
.Sh HISTORY
.Ss Research \s-2UNIX\s0
.Ss Research \s[-1z]UNIX\s0
.\" Copied from Unix Programmer's Manual, V6, 4.2BSD, 4.3BSD, 4.4BSD, 4.4BSD-Lite2 manuals, XPG3
.Nm
appears in the first edition of the UNIX Programmer's Manual as


@@ 335,7 335,7 @@ Symlink ownership is unchangeable as a system limitation, making these operation
Sees
.Op Fl HRfh
replaced with
.Oo Fl R Oo Fl H | Fl L | Fl P Oc Oc Op Fl f ,
.Oo Fl R Oo Fl H \&| Fl L \&| Fl P Oc Oc Op Fl f ,
as present-day.
Symbolic links have lost owners entirely.
.


@@ 354,7 354,10 @@ rather than blindly passing through
.Vt int Ns s
from
.Xr atoi 3
\(em 16 bits on the PDP-11, but 32 bits on the 3B2.
\(em 16 bits on the
.Tn PDP-11 ,
but 32 bits on the
.Tn 3B2 .
.Pp
.At V.4
sees

M man1/chown.1.html => man1/chown.1.html +9 -9
@@ 293,13 293,12 @@ With the owner, in addition to root, being allowed to change the ownership, but
  <b class="Sy">-f</b> <span class="No">] owner file ...</span></div>
With <code class="Fl">-f</code> silencing any errors,
  <code class="Nm">chgrp</code> moved back to <code class="Nm">/bin</code> and
  <a class="Xr" href="https://manpages.debian.org/bullseye/chgrp.1">chgrp(1)</a>,
  and restrictions relaxed to allow <code class="Nm">chgrp</code>ing by the
  owner, so long as they also belong to the target group. However, this is
  entirely artificial, and
  <a class="Xr" href="https://manpages.debian.org/bullseye/chown.8">chown(8)</a>'s
  &quot;Only the super-user can change owner, in order to simplify accounting
  procedures.&quot; stanza is a documentation error: both operations
  <a class="Xr" href="../man1/chgrp.1.html">chgrp(1)</a>, and restrictions
  relaxed to allow <code class="Nm">chgrp</code>ing by the owner, so long as
  they also belong to the target group. However, this is entirely artificial,
  and <a class="Xr" href="../man8/chown.8.html">chown(8)</a>'s &quot;Only the
  super-user can change owner, in order to simplify accounting procedures.&quot;
  stanza is a documentation error: both operations
  (<a class="Xr" href="https://manpages.debian.org/bullseye/chown.2">chown(2)</a>)
  are permitted for root and the owner, but the set-user- and -group-ID bits
  aren't cleared for root, like in <span class="Ux">Version&#x00A0;6 AT&amp;T


@@ 342,7 341,8 @@ With <code class="Fl">-H</code> as present-day, and <code class="Fl">-h</code>
    thereon.</p>
<p class="Pp"><span class="Ux">4.4BSD-Lite2</span> Sees
    [<code class="Fl">-HRfh</code>] replaced with [<code class="Fl">-R</code>
    [<code class="Fl">-H</code> | <code class="Fl">-L</code> |
    [<code class="Fl">-H</code> <code class="Fl">-|</code>
    <code class="Fl">-L</code> <code class="Fl">-|</code>
    <code class="Fl">-P</code>]] [<code class="Fl">-f</code>], as present-day.
    Symbolic links have lost owners entirely.</p>
</section>


@@ 425,7 425,7 @@ and specifies an explicit name-over-numerical-ID precedent. Symbolic links are
</div>
<table class="foot">
  <tr>
    <td class="foot-date">December 30, 2021</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/cut.1 => man1/cut.1 +8 -6
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 30, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt CUT 1
.Os voreutils pre-v0.0.0-latest


@@ 28,7 28,7 @@
Copies bytes, characters, or fields specified by
.Ar range Ns s
from each line of the input
.Ar file Ns s Pq standard input stream if none or Sq Ar -
.Ar file Ns s Pq standard input stream if Qo Sy - Qc , the default ,
to the standard output stream.
.Pp
.Ar range Ns s


@@ 40,7 40,7 @@ can be separated by commas or spaces, and each can be in the format:
.Ar [ from , No \[if] )
.It Ar from Ns Cm - Ns Ar to
.Ar [ from , to ]
.It Li "   " Cm - Ns Ar to
.It Li "\ \ \ \ " Ns Cm - Ns Ar to
.Li [ 1 , Ar to ]
.El
Indices are


@@ 141,7 141,7 @@ couldn't be opened.

.\" TODO: should this have the continued > prompts or just rely on indent?
.Li $ Ic for Ar i Ic in Li $( Ns Nm seq Ar 10 Ns Li ); Ic do
.Li > " " Nm echo Li \&"-$i;$((i+1))-" \&| Nm paste Ar - Li \e
.Li > " " Nm echo Li \&"-$i;$((i+1))-" \&| Nm paste Pa - Li \e
.Li > "   " <( Ns Nm printf Li 'яйцо\enЯЙЦО' \&| Nm cut Fl nb Ar -$i Ns Li )\& \e
.Li > "   " <( Ns Nm printf Li 'яйцо\enЯЙЦО' \&| Nm cut Fl nb Ar $((i+1))- Ns Li )\&
.Li > Ic done


@@ 231,7 231,9 @@ and
.Fl fds ,
with
.Fl c
handling a single ASCII backspace
handling a single
.Tn ASCII
backspace
.Pq Sy 0x08
"as produced by nroff" by not considering it and the next character as being in the position of the previous one
.Pq i.e. Cm printf Li 'abc\ebdef\ebgh\en' \&| Nm Fl c Ns Ar 3 No is So Li c\ebd Sc , Li \&| Nm Fl c Ns Ar 4 No is So Li e Sc , &c.\& .


@@ 253,7 255,7 @@ caused by a transition to reading in blocks, breaks the backspace behaviour.
.Pp
.At V.3
fixes that, and allows
.Qq Ar -
.Qq Sy -
as
.Ar file
to mean the standard input stream.

M man1/cut.1.html => man1/cut.1.html +7 -7
@@ 57,8 57,9 @@
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">Copies bytes, characters, or fields specified by
    <var class="Ar">range</var>s from each line of the input
    <var class="Ar">file</var>s (standard input stream if none or
    &#x2018;<var class="Ar">-</var>&#x2019;) to the standard output stream.</p>
    <var class="Ar">file</var>s (standard input stream if
    &quot;<b class="Sy">-</b>&quot;, the default), to the standard output
    stream.</p>
<p class="Pp"><var class="Ar">range</var>s can be separated by commas or spaces,
    and each can be in the format:</p>
<div class="Bd-indent">


@@ 69,8 70,7 @@
  <dd>[<var class="Ar">from</var>, <span class="No">&#x221E;</span>)</dd>
  <dt><var class="Ar">from</var><code class="Cm">-</code><var class="Ar">to</var></dt>
  <dd>[<var class="Ar">from</var>, <var class="Ar">to</var>]</dd>
  <dt><code class="Li"> </code>
    <code class="Cm">-</code><var class="Ar">to</var></dt>
  <dt><code class="Li">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</code><code class="Cm">-</code><var class="Ar">to</var></dt>
  <dd>[<code class="Li">1</code>, <var class="Ar">to</var>]</dd>
</dl>
</div>


@@ 162,7 162,7 @@ cut <code class="Fl">-zb</code> <var class="Ar">1,3-</var>
  <var class="Ar">10</var><code class="Li">);</code> <code class="Ic">do</code>
<code class="Li">&gt; </code> <code class="Nm">echo</code>
  <code class="Li">&quot;-$i;$((i+1))-&quot; |</code>
  <code class="Nm">paste</code> <var class="Ar">-</var>
  <code class="Nm">paste</code> <span class="Pa">-</span>
  <code class="Li">\</code>
<code class="Li">&gt; &lt;(</code><code class="Nm">printf</code>
  <code class="Li">'&#x044F;&#x0439;&#x0446;&#x043E;\n&#x042F;&#x0419;&#x0426;&#x041E;'


@@ 277,7 277,7 @@ Supporting <code class="Fl">-c</code> and <code class="Fl">-fds</code>, with
    Release&#x00A0;2 UNIX</span>, caused by a transition to reading in blocks,
    breaks the backspace behaviour.</p>
<p class="Pp"><span class="Ux">AT&amp;T System&#x00A0;V Release&#x00A0;3
    UNIX</span> fixes that, and allows &quot;<var class="Ar">-</var>&quot; as
    UNIX</span> fixes that, and allows &quot;<b class="Sy">-</b>&quot; as
    <var class="Ar">file</var> to mean the standard input stream.</p>
<p class="Pp"><span class="St">IEEE Std 1003.2-1992
    (&#x201C;POSIX.2&#x201D;)</span> created <code class="Fl">-b</code> and


@@ 289,7 289,7 @@ Supporting <code class="Fl">-c</code> and <code class="Fl">-fds</code>, with
</div>
<table class="foot">
  <tr>
    <td class="foot-date">December 30, 2021</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/dd.1 => man1/dd.1 +24 -11
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 30, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt DD 1
.Os voreutils pre-v0.0.0-latest


@@ 268,7 268,7 @@ May not mean anything for devices and regular files.
.It Cm noatime
Don't update access time on read.
.It Cm noctty
Don't assign controlling terminal.
Don't assign controlling teletype.
.It Cm nofollow
Error if final path component is a symlink.
.El


@@ 343,12 343,15 @@ Excludes
.Pp
.
.It Cm conv Ns = Ns Cm ebcdic Ns \&| Ns Cm ibm Pq implies Cm conv Ns = Ns Cm block
Transliterate output into EBCDIC (or IBM EBCDIC).
Transliterate output into
.Tn EBCDIC
.Pq or Tn IBM EBCDIC .
These exclude each other and
.Cm conv Ns = Ns Cm ascii .
.
.It Cm conv Ns = Ns Cm ascii Pq implies Cm conv Ns = Ns Cm unblock
Transliterate iutput from EBCDIC
Transliterate iutput from
.Tn EBCDIC
.Pq the inverse of Cm conv Ns = Ns Cm ebcdic .
Excludes
.Cm conv Ns = Ns Cm ebcdic Ns \&| Ns Cm ibm .


@@ 498,7 501,9 @@ which, rather prophetically, is noted in the
section:
.\" Direct quote, formatting and all! What a wonderful age we live in. If only .D1 took Xo/Xc
.Bd -filled -compact -offset indent
The ASCII/EBCDIC conversion tables are
The
.Tn ASCII Ns \[<>] Ns Tn EBCDIC
conversion tables are
taken
from the 256 character standard in
the CACM Nov, 1968.


@@ 527,13 532,17 @@ and changes the
.Sy w
multiplier to be the size of an
.Vt int
.Pq still Em 2 No on the PDP-11, but Em 4 No on the VAX with Tn UNIX/32V .
.\".Pq still Em 2 No on the PDP-11, but Em 4 No on the VAX with At 32v . TODO: cf. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991633
.Pq still Em 2 No on the Tn PDP-11 , No  but Em 4 No on the Tn VAX No with Tn UNIX/32V .
.\".Pq still Em 2 No on the Tn PDP-11 , No but Em 4 No on the Tn VAX No with At 32v . TODO: cf. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991633
.Pp
.At III
uses ASCII\[<>]EBCDIC tables "from a proposed BTL standard April 16, 1979"; they're identical to the ones specified by
uses
.Tn ASCII Ns \[<>] Ns Tn EBCDIC
tables "from a proposed BTL standard April 16, 1979"; they're identical to the ones specified by
.Tn POSIX ,
except mapping ASCII 151 to 8 rather than 11, making them not strictly reciprocal, removes
except mapping
.Tn ASCII
151 to 8 rather than 11, making them not strictly reciprocal, removes
.Cm files Ns = ,
and reverts to
.Sy w


@@ 549,7 558,9 @@ multiplier; this varies depending on the default filesystem (which defaults to t
.Em 512 ) ,
but for standalone programs is equal to
.Em 1024
on the VAX and
on the
.Tn VAX
and
.Em 512
elsewhere.
.Pp


@@ 571,7 582,9 @@ which seeks the input instead of discarding it like
.Cm skip Ns = ,
and
.Cm conv Ns = Ns Cm block Ns \&| Ns Cm unblock ,
which can be selected independently from the EBCDIC conversions.
which can be selected independently from the
.Tn EBCDIC
conversions.
It's also rewritten to be a mess, with option parsing the length of this entire implementation.
.Pp
.Bx 3

M man1/dd.1.html => man1/dd.1.html +8 -7
@@ 237,7 237,7 @@ For example, <code class="Li">3wx6bx2MB</code> corresponds to
      <dt id="noatime"><a class="permalink" href="#noatime"><code class="Cm">noatime</code></a></dt>
      <dd>Don't update access time on read.</dd>
      <dt id="noctty"><a class="permalink" href="#noctty"><code class="Cm">noctty</code></a></dt>
      <dd>Don't assign controlling terminal.</dd>
      <dd>Don't assign controlling teletype.</dd>
      <dt id="nofollow"><a class="permalink" href="#nofollow"><code class="Cm">nofollow</code></a></dt>
      <dd>Error if final path component is a symlink.</dd>
    </dl>


@@ 410,9 410,9 @@ for <i class="Em">1024</i>, <i class="Em">512</i>, <span class="No">and</span>
    The only significant difference is the conversion tables are different than
    the ones mandated by POSIX, which, rather prophetically, is noted in the
    <a class="Sx" href="#BUGS">BUGS</a> section:</p>
<div class="Bd Bd-indent">The ASCII/EBCDIC conversion tables are taken from the
  256 character standard in the CACM Nov, 1968. It is not clear how this relates
  to real life.</div>
<div class="Bd Bd-indent">The ASCII&#x2194;EBCDIC conversion tables are taken
  from the 256 character standard in the CACM Nov, 1968. It is not clear how
  this relates to real life.</div>
<p class="Pp">Indeed, it's equally unclear where <span class="St">IEEE Std
    1003.1-2008 (&#x201C;POSIX.1&#x201D;)</span>'s tables originate, but judging
    from them being monochrome 500x GIFs, it'd be safe to go with the early


@@ 426,8 426,9 @@ for <i class="Em">1024</i>, <i class="Em">512</i>, <span class="No">and</span>
    <var class="Ar">n</var>-<i class="Em">1</i> end-of-files, default
    <b class="Sy">1</b>, and changes the <b class="Sy">w</b> multiplier to be
    the size of an <var class="Vt">int</var> (still <i class="Em">2</i>
    <span class="No">on the PDP-11, but</span> <i class="Em">4</i>
    <span class="No">on the VAX with</span> UNIX/32V).</p>
    <span class="No">on the</span> PDP-11, <span class="No">but</span>
    <i class="Em">4</i> <span class="No">on the</span> VAX
    <span class="No">with</span> UNIX/32V).</p>
<p class="Pp"><span class="Ux">AT&amp;T System&#x00A0;III UNIX</span> uses
    ASCII&#x2194;EBCDIC tables &quot;from a proposed BTL standard April 16,
    1979&quot;; they're identical to the ones specified by POSIX, except mapping


@@ 483,7 484,7 @@ for <i class="Em">1024</i>, <i class="Em">512</i>, <span class="No">and</span>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">December 30, 2021</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/df.1 => man1/df.1 +18 -13
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd March 13, 2022
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt DF 1
.Os voreutils pre-v0.0.0-latest


@@ 94,20 94,25 @@ inserts
as the second column.
.Pp
Available columns are:
.\" mandoc compat; https://inbox.vuxu.org/mandoc-discuss/20220529001500.gnxuiiawdegcjwy7@tarta.nabijaczleweli.xyz/T/
.if !ddoc-Ar-font .ds doc-Ar-font \fI
.if !ddoc-Fn-font .ds doc-Fn-font \fB
.if !ddoc-Li-font .ds doc-Li-font \f(CR
.if !ddoc-Pa-font .ds doc-Pa-font \fI
.TS
lw3 lb lf(CR) l .
	source	Filesystem	Mount source, like \f(CI/dev/nvme0n1p2\fP or \f(CItarta:/pub\fP.
	source	Filesystem	Mount source, like \*[doc-Pa-font]/dev/nvme0n1p2\fP or \*[doc-Pa-font]tarta:/pub\fP.
	fstype	Type	Filesystem type, like \f(CBvfat\fP or \f(CBnfs4\fP.
	itotal	i-nodes	Total amount of i-nodes.
	iused	iUsed	Amount of inodes in use.
	iavail	iFree	Amount of inodes available to unprivileged users.
	ipcent	iUse%	\f(CBceil\fP(100 \(pc \f(CBiused\fP / (\f(CBiused\fP \- \f(CBiavail\fP))\f(CR%\fP
	size	\f(CI1k\fP-blocks	Total capacity, in blocks, rounded up.
	ipcent	iUse%	\*[doc-Fn-font]ceil\fP(100 \(pc \fBiused\fP / (\fBiused\fP \- \fBiavail\fP))\*[doc-Li-font]%\fP
	size	\*[doc-Ar-font]1k\fP-blocks	Total capacity, in blocks, rounded up.
	used	Used	Capacity used, in blocks, rounded up.
	avail	Avail	Capacity available to unprivileged users, in blocks, rounded up.
	pcent	Use%	\f(CBceil\fP(100 \(pc \f(CBused\fP / (\f(CBused\fP \- \f(CBavail\fP))\f(CR%\fP
	file	File	\f(CIpath\fP this corresponds to, or "\f(CB-\fP".
	target	Mounted on	Mount point, like \f(CI/boot\fP or \f(CI/\fP.
	pcent	Use%	\*[doc-Fn-font]ceil\fP(100 \(pc \fBused\fP / (\fBused\fP \- \fBavail\fP))\*[doc-Li-font]%\fP
	file	File	\*[doc-Ar-font]path\fP this corresponds to, or "\f(CB-\fP".
	target	Mounted on	Mount point, like \*[doc-Pa-font]/boot\fP or \*[doc-Pa-font]/\fP.
.TE
.Pp
.Fl hH


@@ 250,7 255,7 @@ It also defines a
XSI extension as "Include total allocated-space figures in the output", but leaves it explicitly unspecified \(em
it is supported in that form on
.At III
derivatives; some, like Solaris, provide an
derivatives; some, like SunOS 5 (Solaris 2), provide an
.Fl F
option with the same meaning as this implementation's
.Fl t


@@ 267,7 272,7 @@ and only supports integer
.Ar base Ns s .
.
.Sh HISTORY
.Ss Research \s-2UNIX\s0
.Ss Research \s[-1z]UNIX\s0
.\" Copied from Unix Programmer's Manual, compared against impl in svntree-20081216.tar.gz, 4BSD tape, 4.* tarballs, and the CSRG ISO
Appears in the first edition of the UNIX Programmer's Manual as
.Xr df I :


@@ 302,7 307,7 @@ This practice continues intermittently across all
that do so.
.
.Ss The BSD
.Bx 4.0
.Bx 4
sees the first version that reads
.Pa /etc/mtab :
.D1 Sy df No \&[ Sy \-i No ]\& \&[ Sy \-l No ]\& \&[ filesystem ... ]\& \&[ file ... ]\&


@@ 391,10 396,10 @@ but sees it as a
comma-separated list of filesystem types.
.
.Ss System V
.Tn PWB/UNIX
.No Programmer's Workbench Pq Tn PWB/UNIX
has
.\" PWB/UNIX (spencer) abuses \c in a way contradictory with a modern interpretation; adapted for your viewing pleasure
.D1 Sy df No \&[ Sy \-uqs No ]\& \&[ Sy \-t No number ]\& [arg ...]
.D1 "\fBdf\fP [ \fB\-uqs\fP ]\& \&[ \fB\-t\fP number ]\& [arg ...]"
and uses
.Pa /etc/mnttab
by default, accepting


@@ 556,7 561,7 @@ The heading is printed whenever the option is specified, but the usage is an int
.El
.
.Ss Standards
\*[doc-Tn-font-size]X/Open\*[doc-str-St] Portability Guide Issue\~2 (\*[Lq]\*[doc-Tn-font-size]XPG\*[doc-str-St]\^2\*[Rq])
.Tn X/Open No Portability Guide Issue\~2 Pq Dq Tn XPG Ns \^2  \" .St -xpg2
specifies
.Nm Op Fl t
with an undefined format.

M man1/df.1.html => man1/df.1.html +25 -33
@@ 87,8 87,7 @@ Where <i class="Em">base</i> is a floating-point amount of bytes, which is then
        <td></td>
        <td><b>source</b></td>
        <td>Filesystem</td>
        <td>Mount source, like <span class="Li"><i>/dev/nvme0n1p2</i></span> or
          <span class="Li"><i>tarta:/pub</i></span>.</td>
        <td>Mount source, like <i>/dev/nvme0n1p2</i> or <i>tarta:/pub</i>.</td>
      </tr>
      <tr>
        <td></td>


@@ 119,10 118,8 @@ Where <i class="Em">base</i> is a floating-point amount of bytes, which is then
        <td></td>
        <td><b>ipcent</b></td>
        <td>iUse%</td>
        <td><span class="Li"><b>ceil</b></span>(100 &#x00B7;
          <span class="Li"><b>iused</b></span> /
          (<span class="Li"><b>iused</b></span> -
          <span class="Li"><b>iavail</b></span>))<span class="Li">%</span></td>
        <td><b>ceil</b>(100 &#x00B7; <b>iused</b> / (<b>iused</b> -
          <b>iavail</b>))<span class="Li">%</span></td>
      </tr>
      <tr>
        <td></td>


@@ 147,10 144,8 @@ Where <i class="Em">base</i> is a floating-point amount of bytes, which is then
        <td></td>
        <td><b>pcent</b></td>
        <td>Use%</td>
        <td><span class="Li"><b>ceil</b></span>(100 &#x00B7;
          <span class="Li"><b>used</b></span> /
          (<span class="Li"><b>used</b></span> -
          <span class="Li"><b>avail</b></span>))<span class="Li">%</span></td>
        <td><b>ceil</b>(100 &#x00B7; <b>used</b> / (<b>used</b> -
          <b>avail</b>))<span class="Li">%</span></td>
      </tr>
      <tr>
        <td></td>


@@ 163,8 158,7 @@ Where <i class="Em">base</i> is a floating-point amount of bytes, which is then
        <td></td>
        <td><b>target</b></td>
        <td>Mounted on</td>
        <td>Mount point, like <span class="Li"><i>/boot</i></span> or
          <span class="Li"><i>/</i></span>.</td>
        <td>Mount point, like <i>/boot</i> or <i>/</i>.</td>
      </tr>
    </table>
    <p class="Pp"><code class="Fl">-hH</code> change the <b class="Sy">size</b>


@@ 292,9 286,9 @@ Where <i class="Em">base</i> is a floating-point amount of bytes, which is then
    &quot;Include total allocated-space figures in the output&quot;, but leaves
    it explicitly unspecified &#x2014; it is supported in that form on
    <span class="Ux">AT&amp;T System&#x00A0;III UNIX</span> derivatives; some,
    like Solaris, provide an <code class="Fl">-F</code> option with the same
    meaning as this implementation's <code class="Fl">-t</code> (except for
    <span class="Pa">/usr/ucb/</span><code class="Nm">df</code>,
    like SunOS 5 (Solaris 2), provide an <code class="Fl">-F</code> option with
    the same meaning as this implementation's <code class="Fl">-t</code> (except
    for <span class="Pa">/usr/ucb/</span><code class="Nm">df</code>,
    <span class="No">which provides</span> <code class="Fl">-t</code>
    <span class="No">as described</span>). The <code class="Fl">-F</code>
    <code class="Fl">-t</code> alias is available but undocumented in the GNU


@@ 341,7 335,7 @@ Writing out plus-separated free block counts for
<section class="Ss">
<h2 class="Ss" id="The_BSD"><a class="permalink" href="#The_BSD">The
  BSD</a></h2>
<p class="Pp"><span class="Ux">4.0BSD</span> sees the first version that reads
<p class="Pp"><span class="Ux">4BSD</span> sees the first version that reads
    <span class="Pa">/etc/mtab</span>:</p>
<div class="Bd Bd-indent"><b class="Sy">df</b> <span class="No">[</span>
  <b class="Sy">-i</b> <span class="No">] [</span> <b class="Sy">-l</b>


@@ 408,11 402,9 @@ format. Multiple instances of <code class="Fl">-t</code> can be used to filter
<section class="Ss">
<h2 class="Ss" id="System_V"><a class="permalink" href="#System_V">System
  V</a></h2>
<p class="Pp">PWB/UNIX has</p>
<div class="Bd Bd-indent"><b class="Sy">df</b> <span class="No">[</span>
  <a class="permalink" href="#uqs"><b class="Sy" id="uqs">-uqs</b></a>
  <span class="No">] [</span> <b class="Sy">-t</b> <span class="No">number ]
  [arg ...]</span></div>
<p class="Pp"><span class="No">Programmer's Workbench</span> (PWB/UNIX) has</p>
<div class="Bd Bd-indent"><b>df</b> [ <b>-uqs</b> ] [ <b>-t</b> number ] [arg
  ...]</div>
and uses <span class="Pa">/etc/mnttab</span> by default, accepting
  <var class="Ar">arg</var>s of either the source device or the mount point. The
  default output is relatively similar to <span class="Ux">Version&#x00A0;5


@@ 575,23 567,23 @@ With <code class="Fl">-f</code>, the output is as default, but without the
</section>
<section class="Ss">
<h2 class="Ss" id="Standards"><a class="permalink" href="#Standards">Standards</a></h2>
<p class="Pp">X/Open Portability Guide Issue&#x00A0;2 (&#x201C;XPG2&#x201D;)
    specifies <code class="Nm">df</code> [<code class="Fl">-t</code>] with an
    undefined format. <span class="St">IEEE Std 1003.2-1992
    (&#x201C;POSIX.2&#x201D;)</span> excludes <code class="Nm">df</code>, as it
    doesn't address the concept of filesystems; it's included in the
    <span class="St">IEEE Std 1003.2a-1992 (&#x201C;POSIX.2&#x201D;)</span>
    (User Portability Extension) supplement, creating
    <code class="Fl">-Pk</code> with their well-defined formats and block sizes
    of today; <span class="St">X/Open Portability Guide Issue&#x00A0;4
    (&#x201C;XPG4&#x201D;)</span> aligns its definition therewith, retaining
    <code class="Fl">-t</code> as an extension.</p>
<p class="Pp">X/Open <span class="No">Portability Guide Issue&#x00A0;2</span>
    (&#x201C;XPG2&#x201D;) specifies <code class="Nm">df</code>
    [<code class="Fl">-t</code>] with an undefined format. <span class="St">IEEE
    Std 1003.2-1992 (&#x201C;POSIX.2&#x201D;)</span> excludes
    <code class="Nm">df</code>, as it doesn't address the concept of
    filesystems; it's included in the <span class="St">IEEE Std 1003.2a-1992
    (&#x201C;POSIX.2&#x201D;)</span> (User Portability Extension) supplement,
    creating <code class="Fl">-Pk</code> with their well-defined formats and
    block sizes of today; <span class="St">X/Open Portability Guide
    Issue&#x00A0;4 (&#x201C;XPG4&#x201D;)</span> aligns its definition
    therewith, retaining <code class="Fl">-t</code> as an extension.</p>
</section>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">March 13, 2022</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/echo.1 => man1/echo.1 +4 -5
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd May 24, 2022
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt ECHO 1
.Os voreutils pre-v0.0.0-latest


@@ 86,8 86,8 @@ This is inherited by
and remains unchanged in the
.Bx .
.Pp
.Tn PWB/UNIX
1.0, based on
.No Programmer's Workbench Pq Tn PWB/UNIX ,
derived from
.At v6 ,
additionally sees
.Sq Sy \en ,


@@ 160,8 160,7 @@ also ships
.At v7
.Nm
under
.Pa /usr/ucb
(this is a Solarisism).
.Pa /usr/ucb .
Its built-in depends on
.Va ucb_builtins :
.Bd -literal -compact -offset indent

M man1/echo.1.html => man1/echo.1.html +6 -5
@@ 99,8 99,9 @@ in the <a class="Sx" href="#BUGS">BUGS</a> section, but this is seemingly
    newline-suppressing first-argument-<code class="Fl">-n</code> behaviour.
    This is inherited by <span class="Ux">3BSD</span>, and remains unchanged in
    the <span class="Ux">BSD</span>.</p>
<p class="Pp">PWB/UNIX 1.0, based on <span class="Ux">Version&#x00A0;6 AT&amp;T
    UNIX</span>, additionally sees &#x2018;<b class="Sy">\n</b>&#x2019;,
<p class="Pp"><span class="No">Programmer's Workbench</span> (PWB/UNIX), derived
    from <span class="Ux">Version&#x00A0;6 AT&amp;T UNIX</span>, additionally
    sees &#x2018;<b class="Sy">\n</b>&#x2019;,
    &#x2018;<b class="Sy">\c</b>&#x2019; which &quot;terminates
    <i class="Em">echo</i> <span class="No">without a newline</span>&quot;, and
    &#x2018;<b class="Sy">\0</b><i class="Em">N</i>&#x2019;, writing the


@@ 142,8 143,8 @@ in the <a class="Sx" href="#BUGS">BUGS</a> section, but this is seemingly
<p class="Pp"><span class="Ux">AT&amp;T System&#x00A0;V Release&#x00A0;4
    UNIX</span> also ships <span class="Ux">Version&#x00A0;7 AT&amp;T
    UNIX</span> <code class="Nm">echo</code> under
    <span class="Pa">/usr/ucb</span> (this is a Solarisism). Its built-in
    depends on <var class="Va">ucb_builtins</var>:</p>
    <span class="Pa">/usr/ucb</span>. Its built-in depends on
    <var class="Va">ucb_builtins</var>:</p>
<div class="Bd Bd-indent Li">
<pre>/*
 * The following flag is set to true if /usr/ucb is found in the path


@@ 177,7 178,7 @@ If set, it uses inlined <span class="Ux">Version&#x00A0;7 AT&amp;T UNIX</span>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">May 24, 2022</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/env.1 => man1/env.1 +9 -11
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 30, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt ENV 1
.Os voreutils pre-v0.0.0-latest


@@ 40,8 40,7 @@
.Oc
.
.Sh DESCRIPTION
.Nm
alters an environment, then prints it to the standard output stream
Аlters the environment, then prints it to the standard output stream
.Pq like Xr printenv 1 ,
or executes
.Ar program


@@ 101,7 100,7 @@ to the remaining arguments.
if no tokens are extracted, but they function identically otherwise.
.El
.
.Ss \f(CB-S\fP TOKENISATION
.Ss \f(CB-S\fP Tokenisation
Much like a vastly trivialised version of shell argument parsing.
The string is split on runs of the space or tab characters, but the single
.Pq Sy '


@@ 184,7 183,7 @@ which may not work on other systems to
will invoke
.Nm
with
.Dq Nm bash Fl e
.Qq Nm bash Fl e
as the first argument \(em the executable to run \(em which won't work.
.Pp
The


@@ 195,10 194,10 @@ option can be used to work around this:
This invokes
.Nm
with
.Dq Fl S Nm bash Fl e
.Qq Fl S Nm bash Fl e
as the first argument, which will then decompose into
.Dq Nm bash
.Dq Fl e .
.Qq Nm bash
.Qq Fl e .
Indeed, the latter can also be written as
.Dl Sy #! Ns Pa /usr/bin/ Ns Nm Fl S Ar PYTHONUNBUFFERED Ns Sy = Ns Ar 1 Nm python3 Fl S
.


@@ 222,7 221,7 @@ and
.It
.Fl 0
is an extension, also present on the GNU system,
.Fx 11.4 ,
.Fx 12.2 ,
and
.Nx current . \" TODO: likewise
.It


@@ 241,8 240,7 @@ is expected to be fully compatible.
.
.Sh HISTORY
.\" Do NOT add formatting here: these are carefully copied from the scan of the CB-UNIX 2.1 manual and the raw 2BSD manpage
.Nm
first appeared in
First appeared in
.Tn CB-UNIX
at or before version 2.1, fully formed, as
.Dl Sy env No [-] [\ name=value\ ] ...\  [\ command args\ ]

M man1/env.1.html => man1/env.1.html +15 -15
@@ 70,8 70,8 @@
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp"><code class="Nm">env</code> alters an environment, then prints it
    to the standard output stream (like
<p class="Pp">&#x0410;lters the environment, then prints it to the standard
    output stream (like
    <a class="Xr" href="../man1/printenv.1.html">printenv(1)</a>), or executes
    <var class="Ar">program</var> therewith.</p>
<p class="Pp">The initial environment is the inherited one, or if


@@ 120,7 120,7 @@
      if no tokens are extracted, but they function identically otherwise.</dd>
</dl>
<section class="Ss">
<h2 class="Ss"><span class="Li"><b>-S</b></span> TOKENISATION</h2>
<h2 class="Ss"><span class="Li"><b>-S</b></span> Tokenisation</h2>
<p class="Pp">Much like a vastly trivialised version of shell argument parsing.
    The string is split on runs of the space or tab characters, but the single
    (<b class="Sy">'</b>) and double


@@ 208,9 208,9 @@ which may not work on other systems to
<div class="Bd
  Bd-indent"><code class="Li"><b class="Sy">#!</b><span class="Pa">/usr/bin/</span><code class="Nm">env</code>
  <code class="Nm">python3</code> <code class="Fl">-uS</code></code></div>
will invoke <code class="Nm">env</code> with
  &#x201C;<code class="Nm">bash</code> <code class="Fl">-e</code>&#x201D; as the
  first argument &#x2014; the executable to run &#x2014; which won't work.
will invoke <code class="Nm">env</code> with &quot;<code class="Nm">bash</code>
  <code class="Fl">-e</code>&quot; as the first argument &#x2014; the executable
  to run &#x2014; which won't work.
<p class="Pp">The <code class="Fl">-S</code> option can be used to work around
    this:</p>
<div class="Bd


@@ 221,12 221,12 @@ will invoke <code class="Nm">env</code> with
  Bd-indent"><code class="Li"><b class="Sy">#!</b><span class="Pa">/usr/bin/</span><code class="Nm">env</code>
  <code class="Fl">-S</code> <code class="Nm">python3</code>
  <code class="Fl">-uS</code></code></div>
This invokes <code class="Nm">env</code> with &#x201C;<code class="Fl">-S</code>
  <code class="Nm">bash</code> <code class="Fl">-e</code>&#x201D; as the first
This invokes <code class="Nm">env</code> with &quot;<code class="Fl">-S</code>
  <code class="Nm">bash</code> <code class="Fl">-e</code>&quot; as the first
  argument, which will then decompose into
  &#x201C;<code class="Nm">bash</code>&#x201D;
  &#x201C;<code class="Fl">-e</code>&#x201D;. Indeed, the latter can also be
  written as
  &quot;<code class="Nm">bash</code>&quot;
  &quot;<code class="Fl">-e</code>&quot;. Indeed, the latter can also be written
  as
<div class="Bd
  Bd-indent"><code class="Li"><b class="Sy">#!</b><span class="Pa">/usr/bin/</span><code class="Nm">env</code>
  <code class="Fl">-S</code>


@@ 247,7 247,7 @@ This invokes <code class="Nm">env</code> with &#x201C;<code class="Fl">-S</code>
      7.1</span>, and <span class="Ux">NetBSD current</span>.</li>
  <li id="0~2"><a class="permalink" href="#0~2"><code class="Fl">-0</code></a>
      is an extension, also present on the GNU system, <span class="Ux">FreeBSD
      11.4</span>, and <span class="Ux">NetBSD current</span>.</li>
      12.2</span>, and <span class="Ux">NetBSD current</span>.</li>
  <li id="v~2"><a class="permalink" href="#v~2"><code class="Fl">-v</code></a>
      is an extension, also present on the GNU system and in a similar form on
      <span class="Ux">FreeBSD 5.5</span>.</li>


@@ 259,8 259,8 @@ This invokes <code class="Nm">env</code> with &#x201C;<code class="Fl">-S</code>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp"><code class="Nm">env</code> first appeared in CB-UNIX at or before
    version 2.1, fully formed, as</p>
<p class="Pp">First appeared in CB-UNIX at or before version 2.1, fully formed,
    as</p>
<div class="Bd
  Bd-indent"><code class="Li"><a class="permalink" href="#env"><b class="Sy" id="env">env</b></a>
  <span class="No">[-] [&#x00A0;name=value&#x00A0;] ...&#x00A0; [&#x00A0;command


@@ 284,7 284,7 @@ This invokes <code class="Nm">env</code> with &#x201C;<code class="Fl">-S</code>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">December 30, 2021</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/expand.1 => man1/expand.1 +147 -30
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 30, 2021
.Dd June 22, 2022
.ds doc-volume-operating-system
.Dt EXPAND 1
.Os voreutils pre-v0.0.0-latest


@@ 18,67 18,87 @@
.Op Fl t Ar stop , Ns Ar stop Ns Oo , Ns Ar stop Oc Ns …
.Oo Ar file Oc Ns …
.Nm unexpand
.Op Fl a
.Op Fl af
.Op Fl t Ar width
.Oo Ar file Oc Ns …
.Nm unexpand
.Op Fl a
.Op Fl af
.Op Fl t Ar stop , Ns Ar stop Ns Oo , Ns Ar stop Oc Ns …
.Oo Ar file Oc Ns …
.
.Sh DESCRIPTION
Expands tab characters from
.Ar file Ns s Pq or the standard input stream ,
writing the result to the standard output stream.
Expands tab characters from each
.Ar file Pq standard input stream if Qo Sy - Qc , the default ,
in order, writing the result to the standard output stream.
.Pp
Each character except for the tab is copied verbatim; each copied character has a width of 1 column,
except for the backspace, which has a width of -1 column.
When a tab is encountered, it's replaced by blanks equal in number to the distance to the next stop;
if it's beyond the final defined stop, it's replaced by a single blank.
Each character except for the tab is copied verbatim.
When a tab is encountered, it's replaced by spaces equal in number to the distance to the next
.Ar stop ;
if it's beyond the final defined
.Ar stop ,
it's replaced by a single space.
.Pp
.Nm unexpand
performs the equivalent processing, but inverse operation,
replacing runs of at least two blanks before each stop with a tab.
If an explicit set of stops is specified, process input lines up to the final stop,
don't output tabs that would exceed that stop, and munge all extraneous spaces in the run thereupto.
.Pq Probably. The semantics here are very subtle and unintuitive, but compatible with Bx 4.4 Ns \&.
.
coalescing runs of initial
.Pq but see Fl a
spaces and tabs before each
.Ar stop
into the minimal count of tabs and spaces yielding the same column.
No processing is done beyond the final
.Ar stop .
.Pp
All characters have the width determined by the current locale, except the tab (the next stop) and backspace
.Pq Sy -1 , No but not before the first column
Invalid multi-byte character sequences are taken to have null width.
.Sh OPTIONS
.Bl -tag -compact -width ".Fl t , -tabs Ns = Ns Ar stop , Ns Ar stop Ns Oo , Ns Ar stop Oc Ns …"
.It Fl t , -tabs Ns = Ns Ar width
Lay out stops at columns equal to integer multiples of
.Ar width Pq default Sy 8 .
Lay out stops every
.Ar width
.Pq default Sy 8 .
.
.It Fl t , -tabs Ns = Ns Ar stop , Ns Ar stop Ns Oo , Ns Ar stop Oc Ns …
Set stops at the specified columns.
Each
.Ar stop
must be further than the last .
must be further than the last.
.Ar stop Ns s
may be separated by the comma, space, and tab characters.
may be separated by the commas, spaces, and tabs.
May also be specified as
.Fl t Ar stop Fl t Ar stop Oo Fl t Ar stop Oc Ns … .
.Pp
.
.It Fl i , -initial
Only expand tabs if they were preceded by just blanks and other tabs.
Only expand tabs if they were preceded by exclusively blanks.
.Pp
.
.It Fl a , -all
Also coalesce blanks if they were preceded by characters other than tabs and other blanks.
Also coalesce runs of at least two spaces-or-tabs after the first non-space-or-tab.
Implied by
.Fl t .
.
.It Fl f , -first-only
Override
.Fl at ,
only coalesce initial spaces-or-tabs.
.El
.
.Sh EXAMPLES
Align tab-separated data:
.Bd -literal -compact -offset 4n
.Li $ Nm printf Li '147.312$\et12$\et12\et2.3%%\en11 520$\et320$\et30\et20%%\en' \&| Nm expand
.Li $ Nm printf Li '147.312$\et12$\et12\et2.3%%\en11 520$\et320$\et30\et20%%\en' \&| Nm
147.312$        12$     12      2.3%
11 520$ 320$    30      20%

.Li $ Nm printf Li '147.312$\et12$\et12\et2.3%%\en11 520$\et320$\et30\et20%%\en' \&| Nm expand Fl t Ar 12
.Li $ Nm printf Li '147.312$\et12$\et12\et2.3%%\en11 520$\et320$\et30\et20%%\en' \&| Nm Fl t Ar 12
147.312$    12$         12          2.3%
11 520$     320$        30          20%
.Ed
.
.Pp
Tabulate a simple form:
.\" Also used in cat.1
.\" Also used in cat.1 at al.
.Bd -literal -compact -offset 4n
.Li $ {
.Li > "  " Nm echo Li Groceries for February :


@@ 92,11 112,108 @@ Groceries for February:
    Bread                $20.21
.Ed
.
.Sh SEE ALSO
.Xr wcwidth 3 ,
.Xr locale 7
.
.Sh STANDARDS
Appeared in
.Bx 1 .
This version is compatible with
.Bx 4.4 .
.Pp
Conforms to
.St -p1003.1-2008 ;
.Nm unexpand
is "unclear"
.Pq Lk https://www.mail-archive.com/austin-group-l@opengroup.org/msg09780.html "Re: unexpand/OPTIONS/-t, STDOUT (&a.) says <space>, which contradicts the <blank> used elsewhere?\&"
on whether folding together non-space blanks is allowed
\(em this implementation doesn't.
This appears to be compatible with
.Fx
and the illumos gate.
.Fl i
is an extension, also present on the GNU system .
and
.Fl -first-only
are extensions, originating from the GNU system.
.Fl f
and non-decimal
.Ar stop Ns s
are extensions.
.
.Sh HISTORY
.\" Copied from 2BSD, 4.0BSD
.Nm
appeared, fully-formed, in
.Bx 2
as
.Xr expand UCB :
.D1 expand \- expand tabs to spaces
with a
.Sx SYNOPSIS
of
.D1 "\fBexpand\fP [ \-tabstop ] [ \-tab1,tab2,...,tabn ] [ file ...  ]"
allowing up to
.Sy 100
decimal
.Ar tab Ns s
interspersed between
.Ar file Ns s .
.Pp
.Bx 4.1c
fixes non-increasing
.Ar tab
detection.
Besides the legacy syntax, this as present-day.
.Pp
.Nm unexpand
appeared in
.Bx 4 ,
sharing
.Xr expand 1 ,
now:
.D1 expand, unexpand \- expand tabs to spaces, or vice versa
as
.D1 "\fBunexpand\fP [ \fB\-a\fP ] [ file ... ]"
aborting each line on the first NUL, and,
despite being documented as present-day:
.D1 If the Fl a No option is given, then tabs are inserted whenever they would compress the resultant file by replacing two or more characters .
each tab is treated as its equivalent amount of spaces, so
.Li '1234567\eta'
yields
.Li '1234567 a'
.Pq i.e. Nm unexpand Em expands No the tab .
.Pp
.At V.4
includes
.Bx 4.2
.Nm
and
.Bx 4.3
.Nm unexpand
in
.Pa /usr/ucb .
.Pp
.St -xpg4
defines
.Nm ,
marking the
.Fl Ns Ar tabstop
syntax OB(solescent), and inventing
.Fl t ,
as present-day.
It also defines
.Nm unexpand
verbatim
.Pq based on the manual, not the implementation \(em this renders the originating Bx No implementation nonconformant !
adding
.Fl t ,
as present-day, for internationalisation and FORTRAN.
Both are part of the User Portability Utilities feature group,
and for both, the input is specified to be text files, so wonky NUL handling is allowed (well, the behaviour is unspecified, since text files don't contain NULs).
.Pp
.St -susv3
removes the obsolete syntax from
.Nm .
.Pp
.St -p1003.1-2008
moves
.Oo Nm un Oc Ns Nm
to the base spec, since its
User Portability Utilities
are exclusively interactive.

M man1/expand.1.html => man1/expand.1.html +120 -35
@@ 43,14 43,14 @@
<table class="Nm">
  <tr>
    <td><code class="Nm">unexpand</code></td>
    <td>[<code class="Fl">-a</code>] [<code class="Fl">-t</code>
    <td>[<code class="Fl">-af</code>] [<code class="Fl">-t</code>
      <var class="Ar">width</var>] [<var class="Ar">file</var>]&#x2026;</td>
  </tr>
</table>
<table class="Nm">
  <tr>
    <td><code class="Nm">unexpand</code></td>
    <td>[<code class="Fl">-a</code>] [<code class="Fl">-t</code>
    <td>[<code class="Fl">-af</code>] [<code class="Fl">-t</code>
      <var class="Ar">stop</var>,<var class="Ar">stop</var>[,<var class="Ar">stop</var>]&#x2026;]
      [<var class="Ar">file</var>]&#x2026;</td>
  </tr>


@@ 58,56 58,72 @@
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">Expands tab characters from <var class="Ar">file</var>s (or the
    standard input stream), writing the result to the standard output
  stream.</p>
<p class="Pp">Each character except for the tab is copied verbatim; each copied
    character has a width of 1 column, except for the backspace, which has a
    width of -1 column. When a tab is encountered, it's replaced by blanks equal
    in number to the distance to the next stop; if it's beyond the final defined
    stop, it's replaced by a single blank.</p>
<p class="Pp">Expands tab characters from each <var class="Ar">file</var>
    (standard input stream if &quot;<b class="Sy">-</b>&quot;, the default), in
    order, writing the result to the standard output stream.</p>
<p class="Pp">Each character except for the tab is copied verbatim. When a tab
    is encountered, it's replaced by spaces equal in number to the distance to
    the next <var class="Ar">stop</var>; if it's beyond the final defined
    <var class="Ar">stop</var>, it's replaced by a single space.</p>
<p class="Pp"><code class="Nm">unexpand</code> performs the equivalent
    processing, but inverse operation, replacing runs of at least two blanks
    before each stop with a tab. If an explicit set of stops is specified,
    process input lines up to the final stop, don't output tabs that would
    exceed that stop, and munge all extraneous spaces in the run thereupto.
    (Probably. The semantics here are very subtle and unintuitive, but
    compatible with <span class="Ux">4.4BSD</span>.)</p>
    processing, but inverse operation, coalescing runs of initial (but see
    <code class="Fl">-a</code>) spaces and tabs before each
    <var class="Ar">stop</var> into the minimal count of tabs and spaces
    yielding the same column. No processing is done beyond the final
    <var class="Ar">stop</var>.</p>
<p class="Pp" id="1">All characters have the width determined by the current
    locale, except the tab (the next stop) and backspace
    (<a class="permalink" href="#1"><b class="Sy">-1</b></a>,
    <span class="No">but not before the first column</span>) Invalid multi-byte
    character sequences are taken to have null width.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="OPTIONS"><a class="permalink" href="#OPTIONS">OPTIONS</a></h1>
<dl class="Bl-tag Bl-compact">
  <dt id="t"><a class="permalink" href="#t"><code class="Fl">-t</code></a>,
    <code class="Fl">--tabs</code>=<var class="Ar">width</var></dt>
  <dd>Lay out stops at columns equal to integer multiples of
      <var class="Ar">width</var> (default
  <dd>Lay out stops every <var class="Ar">width</var> (default
      <a class="permalink" href="#8"><b class="Sy" id="8">8</b></a>).</dd>
  <dt id="t~2"><a class="permalink" href="#t~2"><code class="Fl">-t</code></a>,
    <code class="Fl">--tabs</code>=<var class="Ar">stop</var>,<var class="Ar">stop</var>[,<var class="Ar">stop</var>]&#x2026;</dt>
  <dd>Set stops at the specified columns. Each <var class="Ar">stop</var> must
      be further than the last . <var class="Ar">stop</var>s may be separated by
      the comma, space, and tab characters.</dd>
      be further than the last. <var class="Ar">stop</var>s may be separated by
      the commas, spaces, and tabs. May also be specified as
      <code class="Fl">-t</code> <var class="Ar">stop</var>
      <code class="Fl">-t</code> <var class="Ar">stop</var>
      [<code class="Fl">-t</code> <var class="Ar">stop</var>]&#x2026;.
    <p class="Pp"></p>
  </dd>
  <dt id="i"><a class="permalink" href="#i"><code class="Fl">-i</code></a>,
    <code class="Fl">--initial</code></dt>
  <dd>Only expand tabs if they were preceded by just blanks and other tabs.</dd>
  <dd>Only expand tabs if they were preceded by exclusively blanks.
    <p class="Pp"></p>
  </dd>
  <dt id="a"><a class="permalink" href="#a"><code class="Fl">-a</code></a>,
    <code class="Fl">--all</code></dt>
  <dd>Also coalesce blanks if they were preceded by characters other than tabs
      and other blanks.</dd>
  <dd>Also coalesce runs of at least two spaces-or-tabs after the first
      non-space-or-tab. Implied by <code class="Fl">-t</code>.</dd>
  <dt id="f"><a class="permalink" href="#f"><code class="Fl">-f</code></a>,
    <code class="Fl">--first-only</code></dt>
  <dd>Override <code class="Fl">-at</code>, only coalesce initial
      spaces-or-tabs.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
<p class="Pp">Align tab-separated data:</p>
<div class="Bd Bd-indent Li">
<pre><code class="Li">$</code> <code class="Nm">printf</code> <code class="Li">'147.312$\t12$\t12\t2.3%%\n11 520$\t320$\t30\t20%%\n' |</code> <code class="Nm">expand</code>
147.312$        12$     12      2.3%
11 520$ 320$    30      20%
<pre><code class="Li">$</code> <code class="Nm">printf</code> <code class="Li">'147.312$\t12$\t12\t2.3%%\n11 520$\t320$\t30\t20%%\n' |</code> <code class="Nm"></code></pre>
expand
147.312$ 12$ 12 2.3%
11 520$ 320$ 30 20%

<code class="Li">$</code> <code class="Nm">printf</code> <code class="Li">'147.312$\t12$\t12\t2.3%%\n11 520$\t320$\t30\t20%%\n' |</code> <code class="Nm">expand</code> <code class="Fl">-t</code> <var class="Ar">12</var>
147.312$    12$         12          2.3%
11 520$     320$        30          20%</pre>
</div>
<code class="Li">$</code> <code class="Nm">printf</code>
  <code class="Li">'147.312$\t12$\t12\t2.3%%\n11 520$\t320$\t30\t20%%\n'
  |</code> <code class="Nm"></code>expand <code class="Fl">-t</code>
  <var class="Ar">12</var>
147.312$ 12$ 12 2.3%
11 520$ 320$ 30 20%</div>
<p class="Pp">Tabulate a simple form:</p>
<div class="Bd Bd-indent Li">
<pre><code class="Li">$ {</code>


@@ 124,16 140,85 @@ Groceries for February:
 Bread $20.21</div>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
  ALSO</a></h1>
<p class="Pp"><a class="Xr" href="https://manpages.debian.org/bullseye/wcwidth.3">wcwidth(3)</a>,
    <a class="Xr" href="https://manpages.debian.org/bullseye/locale.7">locale(7)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="STANDARDS"><a class="permalink" href="#STANDARDS">STANDARDS</a></h1>
<p class="Pp">Appeared in <span class="Ux">1BSD</span>. This version is
    compatible with <span class="Ux">4.4BSD</span>.</p>
<p class="Pp"><code class="Fl">-i</code> is an extension, also present on the
    GNU system .</p>
<p class="Pp">Conforms to <span class="St">IEEE Std 1003.1-2008
    (&#x201C;POSIX.1&#x201D;)</span>; <code class="Nm">unexpand</code> is
    &quot;unclear&quot;
    (<a class="Lk" href="https://www.mail-archive.com/austin-group-l@opengroup.org/msg09780.html">Re:
    unexpand/OPTIONS/-t, STDOUT (&amp;a.) says &lt;space&gt;, which contradicts
    the &lt;blank&gt; used elsewhere?</a>) on whether folding together non-space
    blanks is allowed &#x2014; this implementation doesn't. This appears to be
    compatible with <span class="Ux">FreeBSD</span> and the illumos gate.
    <code class="Fl">-i</code> and <code class="Fl">--first-only</code> are
    extensions, originating from the GNU system. <code class="Fl">-f</code> and
    non-decimal <var class="Ar">stop</var>s are extensions.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp"><code class="Nm">expand</code> appeared, fully-formed, in
    <span class="Ux">2BSD</span> as
    <a class="Xr" href="https://manpages.debian.org/bullseye/expand.UCB">expand(UCB)</a>:</p>
<div class="Bd Bd-indent">expand - expand tabs to spaces</div>
with a <a class="Sx" href="#SYNOPSIS">SYNOPSIS</a> of
<div class="Bd Bd-indent"><b>expand</b> [ -tabstop ] [ -tab1,tab2,...,tabn ] [
  file ... ]</div>
allowing up to
  <a class="permalink" href="#100"><b class="Sy" id="100">100</b></a> decimal
  <var class="Ar">tab</var>s interspersed between <var class="Ar">file</var>s.
<p class="Pp"><span class="Ux">4.1cBSD</span> fixes non-increasing
    <var class="Ar">tab</var> detection. Besides the legacy syntax, this as
    present-day.</p>
<p class="Pp"><code class="Nm">unexpand</code> appeared in
    <span class="Ux">4BSD</span>, sharing
    <a class="Xr" href="../man1/expand.1.html">expand(1)</a>, now:</p>
<div class="Bd Bd-indent">expand, unexpand - expand tabs to spaces, or vice
  versa</div>
as
<div class="Bd Bd-indent"><b>unexpand</b> [ <b>-a</b> ] [ file ... ]</div>
aborting each line on the first NUL, and, despite being documented as
  present-day:
<div class="Bd Bd-indent">If the <code class="Fl">-a</code>
  <span class="No">option is given, then tabs are inserted whenever they would
  compress the resultant file by replacing two or more characters</span></div>
. each tab is treated as its equivalent amount of spaces, so
  <code class="Li">'1234567\ta'</code> yields <code class="Li">'1234567
  a'</code> (i.e. <code class="Nm">unexpand</code>
  <a class="permalink" href="#expands"><i class="Em" id="expands">expands</i></a>
  <span class="No">the tab</span>).
<p class="Pp"><span class="Ux">AT&amp;T System&#x00A0;V Release&#x00A0;4
    UNIX</span> includes <span class="Ux">4.2BSD</span>
    <code class="Nm">expand</code> and <span class="Ux">4.3BSD</span>
    <code class="Nm">unexpand</code> in <span class="Pa">/usr/ucb</span>.</p>
<p class="Pp"><span class="St">X/Open Portability Guide Issue&#x00A0;4
    (&#x201C;XPG4&#x201D;)</span> defines <code class="Nm">expand</code>,
    marking the <code class="Fl">-</code><var class="Ar">tabstop</var> syntax
    OB(solescent), and inventing <code class="Fl">-t</code>, as present-day. It
    also defines <code class="Nm">unexpand</code> verbatim (based on the manual,
    not the implementation &#x2014; this renders the originating
    <span class="Ux">BSD</span> <span class="No">implementation
    nonconformant</span>)! adding <code class="Fl">-t</code>, as present-day,
    for internationalisation and FORTRAN. Both are part of the User Portability
    Utilities feature group, and for both, the input is specified to be text
    files, so wonky NUL handling is allowed (well, the behaviour is unspecified,
    since text files don't contain NULs).</p>
<p class="Pp"><span class="St">Version&#x00A0;3 of the Single UNIX Specification
    (&#x201C;SUSv3&#x201D;)</span> removes the obsolete syntax from
    <code class="Nm">expand</code>.</p>
<p class="Pp"><span class="St">IEEE Std 1003.1-2008
    (&#x201C;POSIX.1&#x201D;)</span> moves
    [<code class="Nm">un</code>]<code class="Nm">expand</code> to the base spec,
    since its User Portability Utilities are exclusively interactive.</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">December 30, 2021</td>
    <td class="foot-date">June 22, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/expr.1 => man1/expr.1 +4 -4
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 30, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt EXPR 1
.Os voreutils pre-v0.0.0-latest


@@ 193,7 193,7 @@ This is a debugging feature and will be removed.
.El
.
.Sh EXIT STATUS
.Bl -tag -compact -width "Sy 0"
.Bl -tag -compact -width ".Sy 0"
.It Sy 0
The expression evaluated to neither the null string nor
.Sy 0 .


@@ 283,8 283,8 @@ or start the argument list with a
.Fl - .
.
.Sh HISTORY
Appears in Edition 1.0 of The
.Tn PWB/UNIX
Appears in The
.No Programmer's Workbench Pq Tn PWB/UNIX
User's Manual, allowing
.Cm () , |&+-*/% , substr , length , No and Cm index ,
with the binary operators corresponding solely to their C equivalents on 16-bit

M man1/expr.1.html => man1/expr.1.html +7 -7
@@ 384,12 384,12 @@ expr <var class="Ar">$#</var> <code class="Cm">\&lt;=</code> <code class="Li">5
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">Appears in Edition 1.0 of The PWB/UNIX User's Manual, allowing
    <code class="Cm">()</code>, <code class="Cm">|&amp;+-*/%</code>,
    <code class="Cm">substr</code>, <code class="Cm">length</code>,
    <span class="No">and</span> <code class="Cm">index</code>, with the binary
    operators corresponding solely to their C equivalents on 16-bit
    <var class="Vt">int</var>s.</p>
<p class="Pp">Appears in The <span class="No">Programmer's Workbench</span>
    (PWB/UNIX) User's Manual, allowing <code class="Cm">()</code>,
    <code class="Cm">|&amp;+-*/%</code>, <code class="Cm">substr</code>,
    <code class="Cm">length</code>, <span class="No">and</span>
    <code class="Cm">index</code>, with the binary operators corresponding
    solely to their C equivalents on 16-bit <var class="Vt">int</var>s.</p>
<p class="Pp">Edition 2.3 of The CB-UNIX Programmer's Manual sees 32-bit
    numbers, <code class="Cm">|</code>, <code class="Cm">&amp;</code>,
    {<code class="Cm">=</code>, <code class="Cm">&gt;</code>,


@@ 461,7 461,7 @@ expr <var class="Ar">$#</var> <code class="Cm">\&lt;=</code> <code class="Li">5
</div>
<table class="foot">
  <tr>
    <td class="foot-date">December 30, 2021</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/factor.1.html => man1/factor.1.html +4 -4
@@ 89,10 89,10 @@ factor <var class="Ar">1410 1981</var>
  Bd-indent"><code class="Li"><a class="permalink" href="#factor"><b class="Sy" id="factor">factor</b></a>
  <code class="Li">[ number ]</code></code></div>
<p class="Pp">A direct C port appeared in <span class="Ux">4.1BSD</span> as
    <a class="Xr" href="https://manpages.debian.org/bullseye/factor.6">factor(6)</a>.
    It had been rewritten in <span class="Ux">4.3BSD-Reno</span> to parse one
    number per line, as opposed to just separating them by whitespace, and
    handle multiple arguments.</p>
    <a class="Xr" href="../man6/factor.6.html">factor(6)</a>. It had been
    rewritten in <span class="Ux">4.3BSD-Reno</span> to parse one number per
    line, as opposed to just separating them by whitespace, and handle multiple
    arguments.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1>

M man1/head.1 => man1/head.1 +2 -2
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 30, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt HEAD 1
.Os voreutils pre-v0.0.0-latest


@@ 169,7 169,7 @@ Appeared mostly fully-formed in
.Bx 1
as
.Xr head VI :
.D1 Sy head No \&[ Sy \- Ns "count ] [ file ... ]"
.D1 "\fBhead\fP [ \fB\-\fPcount ] [ file ... ]"
with
.Ar count Ns s
interspersable among

M man1/head.1.html => man1/head.1.html +2 -4
@@ 158,9 158,7 @@ echo &quot;PYTHONUNBUFFERED=$PYTHONUNBUFFERED&quot;
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">Appeared mostly fully-formed in <span class="Ux">1BSD</span> as
    <a class="Xr" href="https://manpages.debian.org/bullseye/head.VI">head(VI)</a>:</p>
<div class="Bd
  Bd-indent"><a class="permalink" href="#head"><b class="Sy" id="head">head</b></a>
  <span class="No">[</span> <b class="Sy">-</b>count ] [ file ... ]</div>
<div class="Bd Bd-indent"><b>head</b> [ <b>-</b>count ] [ file ... ]</div>
with <var class="Ar">count</var>s interspersable among
  <var class="Ar">file</var>s.
<p class="Pp"><span class="Ux">4.3BSD-Reno</span> fixes this, only allowing it


@@ 182,7 180,7 @@ with <var class="Ar">count</var>s interspersable among
</div>
<table class="foot">
  <tr>
    <td class="foot-date">December 30, 2021</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/hostid.1 => man1/hostid.1 +860 -7
@@ 1,6 1,8 @@
'\" et
.\" SPDX-License-Identifier: 0BSD
.\" mandoc-ignore: WARNING: sections out of conventional order: Sh HISTORY
.\"
.Dd June 13, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt HOSTID 1
.Os voreutils pre-v0.0.0-latest


@@ 11,16 13,867 @@
.Sh SYNOPSIS
.Nm
.
.EQ
delim $$
.EN
.
.Sh DESCRIPTION
Prints the supposedly-unique identifier of the host, as obtained via
Writes the supposedly-unique identifier of the host, as obtained via
.Xr gethostid 3 ,
formatted as a zero-padded eight-character hexadecimal string.
.Pp
formatted as a zero-padded eight-character hexadecimal string, followed by a newline, to the standard output stream.
.
.Sh SEE ALSO
.Xr gethostid 3
.
.Sh STANDARDS
Compatible with
SunOS 4 (Solaris).
.
.Sh CAVEATS
The
.Xr gethostid 3
function has many inherent problems and varies wildly (or, indeed, not at all) across implementations;
function has many inherent problems and varies wildly across implementations and usually not at all across systems,
and is not required to mean anything
.Pq cf. Sx HISTORY , Standards , No below ;
you should use neither it, nor
.Nm .
.Nm
.Pq which is, additionally, sparsely available, cf. Sx HISTORY , Status quo , No below .
.Pp
There are
.Em some
useful ways of distinguishing hosts
\(em hostnames, at a small scale, the UUID in
.Pa /etc/machine-id
.Pq systemd Xr machine-id 5 ,
the
.Va kern.hostuuid
sysctl
.Pq Fx Xr sysctl 3 ,
or one generated on package installation.
.Nm
isn't.
.
.Sh SEE ALSO
.Sh HISTORY
.Ss The BSD
Appeared in
.Bx 4.2
.Pq undocumented in Bx 4.1c , except Xr gethostid 2 , with a single difference, noted below
as
.D1 hostid \- set or print identifier of current host system
either
.Li %x Ns -printing
.Xr gethostid 2 ,
or, if specified,
.Li %x Ns -parsing
the first argument
.Pq Ar identifier ,
and passing it to
.Xr sethostid 2 .
.Pp
Both
.Xr hostid 1
and
.Xr gethostid 2
reiterate that this "32-bit identifier" is "intended to be unique among all UNIX systems in existence.",
and is, per norm, a "DARPA Internet address" for the host.
.\" "normally, this is"
They also specify that the identifier is for the "processor",
which is a fun thought to consider, given that uniprocessor systems have been extinct for decades now
.Pq indeed, contemporary Tn 3B2 No systems were multiprocessor ex definitione .
.Pp
.Xr gethostid 2
has a
.Pf new-in- Bx 4.2
.Sx BUGS
sexion declaring the retrospectively as obvious as had appeared between April and August of 1983:
.D1 32 bits for the identifier is too small.
.Pp
The syscalls do exactly nothing except either returning a global
.Vt long Va hostid Ns Li \&; ,
or assigning to it if the caller is root
.Pq Er EPERM Ns ing otherwise .
.Pp
.Xr hostid 1
also specs that assignation is "usually" done in
.Pa /etc/rc.local ,
but the distribution startup scripts do not specify it
.Pq which would be impossible without another dedicated program to parse Pa /etc/hosts
or indicate that it should be inserted there.
Similarly, the kernel doesn't use
.Va hostid
at all (except for holding it), and the userland doesn't use
.Xr [gs]ethostid 2
at all
.Pq except in Nm ;
althugh
.Xr getpid 2
.Pq since Bx 4.1c , but with a typo in the crossref
recommends it, proclaiming that it is most often
.Qq used with the host identifier Xr gethostid 2 to generate uniquely-named temporary files.\& .
.Pp
.Bx 4.3
declares setting the host ID in
.Pa /etc/rc.local
common, rather than the norm, and allows hostnames
.Pq the first address from Xr gethostbyname 3N , if any ,
then dot-notation addressses via
.Xr inet_addr 3N
.Pq if the identifier contains a dot Pq Sq Sy \&. ,
both in host (little) byte order,
then a hexadecimal number with an optional
.Sy 0x Ns / Ns Sy 0X
prefix; there's a usage string designating the argument "hexnum or internet address" if all the aforementioned methods fail,
but the manual
.Sx SYNOPSIS
is not updated
.Pq the Sx DESCRIPTION No now says that a number "or the hostname" may be passed .
The no-argument output is
.Sy 0x Ns -prefixed
.Pq Li %#x Ns -formatted .
.Pp
Thanks to this, the distribution
.Pa /etc/rc.local
runs
.Dl Nm Li ` Ns Nm hostname Ns Li `
but the only other new user is the
.Xr hunt 6
driver, using
.Xr gethostid 2
as the player's machine if configured for playing in the
.Dv UNIX
domain
(otherwise, in the
.Dv INTERNET
domain, it's the calling peer's address in host byte order),
and the
.Xr getpid 2
recommendation disappears.
.Xr [gs]ethostid 2
also return/take
.Vt long Ns s
\(em both are 4 bytes on the ILP32
.Tn VAX ,
the only potential reasoning for this would be overfitting to the ARPA network long (4 bytes), as opposed to the network short (2 bytes);
it is, nonetheless, inexplicable.
.Pp
.Bx 4.3 Tahoe
propagates the synopsis change to the
.Sx SYNOPSIS ,
and the
.Xr [gs]ethostid 2
types to the formatting/parsing specifiers as
.Li %#lx Ns / Ns Li %lx  .
It also, unrelatedly, moves network initalisation, including the
.Nm
call-site, to
.Pa /etc/netstart .
.Pp
.\" TODO: how do we want to highlight this?
Networking Release 2 (Net/2)
omits
.Nm ,
with the only user of
.Xr gethostid 2
being as part of the salt for random DES key generation in libdes
.Pq Xr des_crypt 3
.Pq the only part of Tn MIT No Kerberos 4 in the distribution ,
and no
.Xr sethostid 2
callers.
.Pp
.Bx 4.4
sees
.Nm ,
unchanged, in
.Pa /usr/old
.Pq as opposed to Pa /bin No in previous releases ,
and
.Xr [gs]ethostid 3
as
.Lb libc
shims in the
.Pa compat-43
subdirectory \(em deprecated in favour of, and implemented in terms of, the
.Pf new-in- Bx 4.4
.Sy sysctl
mechanism
.Pq documented as Xr sysctl 2 , but actually Xr sysctl 3
under the
.Brq Dv CTL_KERN , KERN_HOSTID
.Pq Qo Va kern.hostid Qc symbolic Xr sysctl 8
name, documented as "Get or set the host id.".
The syscalls are likewise retained for compatibility
.Pq but only if Dv COMPAT_43 Po Fn osethostid Pc or either Dv COMPAT_43 No or Dv COMPAT_SUNOS , No as part of SunOS emulation Po Fn ogethostid Pc is defined at build-time ,
but renamed to
.Dv SYS_o Ns Oo Dv gs Oc Ns Dv ethostid .
.Va hostid
is initialised
.Pq other than the Sy 0 No default
on the
.Tn SPARC Pq Sun-4c
port, attempting compatibility with SunOS \(em from the ID PROM residing in the Mostek MK48T02 time-of-day clock device's MMIO area
.\" * Sun-4c clock Mostek TOD clock.  This includes the ``id prom''.
.\"
.\" * Mostek MK48T02 clock.
.\" *
.\" * The clock includes 2040 bytes of RAM, the last 32 of which serve to
.\" * identify the kind of Sun 4c this is.
(or, from the FORTH PROM perspective, the "eeprom" device's, that also happens to contain the clock, MMIO area),
with the highest byte being the machine type, the middle two bytes being the first two bytes of the 3-byte host ID field,
and the lowest byte also being the first byte.
.Pp
.Bx 4.4 Lite
drops
.Nm
entirely.
.Pp
.Bx 4.4 Lite2
fixes
.Va hostid
initialisation by assigning the final byte of the host ID PROM field to the lowest byte, finally achieving compatibility with SunOS
and renames all
.Li o Ns (ld)-prefixed
syscalls to be
.Li compat_43_ Ns -prefixed
instead.
.\" But not on the news arch and pmax/ultrix comapt?
.Pp
This leaves the
.Bx
at exactly two users, ever, being part of the distribution:
.Xr hunt 6
and MIT Kerberos 4 libdes.
.
.Ss SunOS
The
.Bx 4.2 Ns -based
SunOS
carries its
.Nm
and
.Xr gethostid 2 ,
but removes
.Fn sethostid
\(em
.Xr hostid 1
says simply that
.\" 700-1015-01_SunOS_1.1_1600bpi.zip
.D1 This numeric value is unique across all hosts.
and
.Xr gethostid 2
is much less verbose
.Pq and Sx BUGS Ns -free ,
saying only that the 32-bit identifier is likewise "unique across all hosts".
.Pp
SunOS 2
actually removes the
.Xr sethostid 2
.\" SunOS 2.0 (Tape) [Sun-2]
syscall and clarifies  in
.Xr hostid 1
that the value is unique "across all \fISun\fP hosts" (font change original),
but in
.Xr gethostid 2
that it just "should be" unique, and clarifies, that
.D1 On the Sun, this number is taken from the CPU board's ID PROM.
.Pp
Save for minor maturing formatting choices (including a non-italic "Sun"),
the only real difference comes in
.Bx 4.3 Ns -derived
SunOS 4 (Solaris)
.\" 4.1.4 here ("solaris1.1.2" vetusware ISO)
whose
.Nm
formats
.Xr gethostid 2
(now decelestialised to "a Sun workstation")
as
.Li %08x
(the same as this implementation!).
Therein also lies the first user in the distribution:
.Xr snap 1
via list of hosts to administer in
.Xr systems 5
(although, respectively: only available on "Sun 386i systems" running SunOS 4.0, removed in SunOS 4.1; optional, empty by default),
explicitly specifying the
.Nm
output format.
.Pp
Predictably, most binaries distributed in the
.Sy User_Diag
package use
.Xr gethostid 2 .
OpenWindows
uses it in a few places, most notably
.Pq as its inetd server Xr ttdbserverd 8 Po Nm rpc.ttdbserverd Pc is in the Sy usr No package
for the ToolTalk database.
.
.Ss System V
.At V.4
(x86),
as part of the
.Bx 4.3
merge, includes a new
.Xr sysinfo 2
syscall for returning data as strings;
some already available as part of
.Xr uname 2
.Pq Dv SI_SYSNAME , SI_HOSTNAME , SI_RELEASE , SI_VERSION , SI_MACHINE ,
with the hostname now newly settable via
.Dv SI_SET_HOSTNAME
("unpublished" despite being in the header)
\(em the only official interface being
.Fn sethostid
as part of
libucb
.Pq Qq Li ucblibc
in the
.Sy compat
package (the "BSD compatibility package").
.Pp
Likewise, therein resides
.Fn gethostid ,
parsing the result of
.Dv SI_HW_SERIAL
\(em the
.Vt char Va hw_serial Ns Vt [] Ns Li \&;
kernel variable, assigned from the
.Dv HW_SERIAL
macro
.Li \&"0"
\(em as
.Li %12x
.Pq despite (a) the buffer size being Dv HOSTIDLEN Po Sy 40 Pc and (b) Sy 12 No not matching any reasonable limit Pq Sy 8 No for Li %x , Sy 10 No for Li %d , Sy 11 No for Li %o
and
.Fn printf Ns s
.Li \&"name = %s"
the result beforehand.
.\" Yes!! https://twitter.com/nabijaczleweli/status/1528503939280384000
.Pp
.Pa /usr/ucb/ Ns Nm ,
also relegated to the package, just
.Fn printf Ns s
the
.Nm sysinfo Pq Dv SI_HW_SERIAL
output (although with a 256-byte buffer).
.Pp
The
.Tn 3B2
port defines
.Dv HW_SERIAL
to
.Li \&"serial number"
.Pq and doesn't ship the Sy compat No package
\(em this is not a respected API on
.Tn AT&T Ns 's
part.
.
.Ss SunOS (again)
SunOS 5 (Solaris 2),
now based on
.At V.4 ,
inherits its
.Xr sysinfo 2 ;
libucb
.Pq Qq Li ucblibc
.Fn gethostid
is fixed
(by removing the
.Fn printf ,
parsing with
.Fn strtoul
in explicit
.Pf base- Sy 10 ,
handling the parse error, if any
.Pq returning Sy -1 , No later dubbed Dv HW_INVALID_HOSTID ,
and likewise returning
.Sy -1
for an ID of
.Sy 0 ) .
.Pp
However,
.Lb libc
.Em also
carries a
.Xr gethostid 3
implementation,
which is both entirely unrelated and entirely identical
(except that it uses a slightly bigger buffer, which doesn't matter, since
.Va hw_serial
is
.Sy 11
.Vt char Ns s
.ie n (2\(ha32
.el   \{ $ (2 sup 32 $ \}
+ NUL) long and the additional byte's space in the receiving buffer is not passed to
.Xr sysinfo 2
and doesn't return an error for an ID of
.Sy 0 ) .
.Pp
.Nm
also prints an error
.Pq Qq bad hostid format
and exits
.Sy 1
if
.Xr gethostid 3
returns
.Sy -1 ,
i.e. if the
.Xr sysinfo 2
call fails, which it can't, but is otherwise equivalent to
SunOS 4 (Solaris)'.
.Pp
For all
.Tn SPARC Pq Sun-4 , SPARC V9
platforms the scheme is the same as in
.Bx 4.4
(unsurprisingly), although expressed much more succinctly as
.Dl idprom.id_machine << 24 + idprom.id_serial
because
.Tn SPARC Pq Sun-4
is big-endian.
The capitalisation du jour appears to be "IDprom".
For Intel platforms (x86, IA64),
.Va hw_serial
.Pq among Va hw_provider Po Dv SI_HW_PROVIDER Pc &al.\&
is supposed to be initialised by the bootloader from
.Pa /etc/bootrc
\(em
said code
.Em does
exist for the hostname
.Pq by specifying Li setprop si-machine Ar the-hostname
and
.Va hw_provider
.Pq Li si-hw-provider
\(em
but the only way
.Va hw_serial
is changed from its
.Li \&"0"
initialiser on x86 is by loading, then immediately unloading, the
.Pa misc/sysinit
module which takes a lot of complicated-looking math and a manual
.Fn sprintf %u
implementation to also write the constant
.Li \&"0"
via the
.Va _hs1107
DDI-workaround symbol.
.ie n Yes[1].
.el   Yes\(S1.
.ie n Reportedly[2],
.el   Reportedly\(S2,
some SunOS distributors provide their own module.
.Tn COMPAQ ,
as a vendor, is additionally autodetected on x86 by matching on
.Li \&"COMPAQ"
at a magic address and setting
.Va hw_provider
.Li \&"COMPAQ" .
.Pp
The only users of
.Xr gethostid 3
in the distribution are
.Nm in.ndpd
(Neighbor Discovery for IPv6, RFC2461),
if any non-loopback IPv6 interface exists,
.Nm in.ripngd
(Routing Information Protocol for IPv6, RFC2080),
if the host is an IPv6 router, \" (/etc/inet/ndpd.conf exists)
and
.Nm in.rdisc
(ICMP Router Discovery Protocol, RFC1256),
if the host is an IPv4 router. \" (there's a lot of hilarious heuristics in /etc/init.d/inetinit)
All of them use it exactly once and exactly in the same way: by calling
.D1 Nm srandom Ns Li \&( Ns Nm gethostid Ns Li ());\&
.\" in.rdisc has a #ifdef SYSV, srand(gethostid()); same difference
.
.Ss Standards
.St -xpg4.2
includes
.Fn gethostid
as an
.Tn X/OPEN UNIX No Extension ;
the migration guide describes it succinctly:
.Bd -filled -compact -offset indent
The
.Fn gethostid
function retrieves a 32-bit identifier for the current host.
X/Open does not define the domain in which the return value is unique.
.Ed
.Pp
.St -susv2
moves it to BASE, as an
X/Open Systems Interfaces (XSI)
extension to the C standards,
.
.Ss Status quo
.\" mandoc compat; https://inbox.vuxu.org/mandoc-discuss/20220529001500.gnxuiiawdegcjwy7@tarta.nabijaczleweli.xyz/T/
.if !ddoc-Dv-font .ds doc-Dv-font \f(CR
.if !ddoc-Fn-font .ds doc-Fn-font \fB
.if !ddoc-Li-font .ds doc-Li-font \f(CR
.if !ddoc-Nm-font .ds doc-Nm-font \fB
.if !ddoc-Pa-font .ds doc-Pa-font \fI
.if !ddoc-Sy-font .ds doc-Sy-font \fB
.if !ddoc-Va-font .ds doc-Va-font \fI
.if !ddoc-Xr-font .ds doc-Xr-font \fR
.if !ddoc-Tn-font-size .ds doc-Tn-font-size \s+0
.ds SPARC  \*[doc-Tn-font-size]SPARC\s0
.ds 4.4BSD 4.4\^\*[doc-Tn-font-size]BSD\s0
.ds sNx \*[doc-Tn-font-size]NetBSD\s0
.ds sOx \*[doc-Tn-font-size]OpenBSD\s0
.ds sFx \*[doc-Tn-font-size]FreeBSD\s0
.TS
lb lb lb lb lb
l  lb l  l  l
l  lb l  l  l
l  lb l  l  l
l  lb l  l  l
l  lb l  l  l
l  lb l  l  s
l  lb l  l  s
l  lb l  l  l
l  lb l  l  l
l  lb l  l  l
l  lb l  l  l
l  lb l  l  l
l  lb l  l  l
l  lb l  l  l
l  lb l  l  l
l  lb l  l  l
l  lb l  l  l
l  lb l  l  l
l  lb l  l  l
l  lb l  l  l
l  lb l  l  l
l  lb l  l  l
=  =  =  =  l
r  rb lz s  s  .
.
Platform	Flags	API	Source	Notes
_
.\" git head 2022-05-29, also see [1]
illumos/\*[SPARC]	khx	SunOS	\*[SPARC] ID PROM	Can be configured per-zone
illumos/x86	kxp	SunOS	[M1]	(likewise)

.\" CVS head 2022-05-29
\*[sNx]/\*[SPARC]	khs	\*[4.4BSD]	\*[SPARC] ID PROM
\*[sNx]/newsmips	khs	\*[4.4BSD]	ID ROM	4-byte serial field
\*[sNx]/news68k	ks	\*[4.4BSD]	Likewise (2-byte on the \*[doc-Tn-font-size]1[4567]00\s0), but not exported to \*[doc-Va-font]hostid\fP
\*[sNx]/Amiga	khs	\*[4.4BSD]	Serial of DraCo workstation, stored on battery-backed RTC (\*[doc-Xr-font]drbbc\fP(4))
\*[sNx] 	ks	\*[4.4BSD]	None; \*[doc-Sy-font]0\fP	\*[doc-Dv-font]SYS_compat_43_o\fP[\*[doc-Dv-font]gs\fP]\*[doc-Dv-font]ethostid\fP supported

.\" git head 2022-05-29
\*[sOx]/\*[SPARC]64	khs	\*[4.4BSD]	\*[SPARC] ID PROM
\*[sOx] 	ks	\*[4.4BSD]	None; \*[doc-Sy-font]0\fP

.\" git head 2022-05-29
\*[sFx]	ksp	\*[4.4BSD]	[M2]	Private per-jail; supports old syscalls
.\" glibc 2.33-7 (Debian)
(glibc/k\*[sFx])				(if configured with \*[doc-Dv-font]COMPAT_43\fP), no \*[doc-Dv-font]SYS_\fP macros

GNU	spx		\*[doc-Pa-font]/etc/hostid\fP	[M3]

glibc/Linux	spx		[M4]	All userlands provide a compatible \*[doc-Nm-font]hostid\fP
.\" musl 1.2.2-1 (Debian)
musl/Linux	x		None; \*[doc-Sy-font]0\fP	(likewise)
.\" uClibc-0.9.33.2.tar.xz, uClibc-ng-1.0.41.tar.xz
uClibc[-ng]/Linux	spx		[M4]	(likewise); \*[doc-Fn-font]sethostid\fP() only if \*[doc-Dv-font]USE_BSD\fP (the default)
.\" TODO: this spills the margin \(ha
.\" CVS head 2022-05-29
dietlibc/Linux			N/A
.\" git head 2022-05-29
Bionic/Linux			N/A	\*[doc-Li-font]in_posix_and_glibc_but_actually_dead\fP

Legend:	k	stored in the kernel
	h	hardware-derived
	s	can be set
	p	persisted in userspace
	x	has hostid(1)
.TE
.
.Ss Status quo \(em illumos/x86 \fR[M1]\fP
During kernel startup,
.Pa /etc/hostid
is opened; if that succeeds, it's lexed as a series of system config file
(newline-delimited, whitespace-insignificant,
.Sy # Ns -commented ,
typed text, strings
.Sy \&"" Ns -wrapped ;
.Xr system 5 )
strings, each decoded from
.Tn ROT47 ,
parsed again as a system config file number
.\" kobj_getvalue()
.Pq case-insensitive , Sy - , ~ No operators for negation and bitwise inversion, automatic base detection between Sy 8 , 10 , No and Sy 16 No from prefix ,
the final valid of which wins (with invalid numbers warned about).
If no valid numbers exist
.Pq or the final one was the aforementioned Dv HW_INVALID_HOSTID No (all bits set), used as an initialiser
a warning is issued about the file being corrupt, and
.Va hw_serial
is unchanged
.Pq Sy \&"0" .
Following that, another warning is issued about the inability to set the host ID.
.Pp
If it doesn't, then the legacy
.Pa misc/sysinit
module is loaded, which, if succeeds, is followed by parsing
.Va hw_serial .
If it fails, and the system has a non-disabled
.Tn SMBIOS ,
then its UUID is used, but not if it's all-zeroes, all-ones, or another known-bad value
(in which case this step is skipped with a warning to "Contact BIOS manufacturer for repair." (as if!)).
The host ID is initialised to
.Sy 0 ,
then consecutive bytes of the UUID XORed with consecutive bytes thereof,
starting with the least significant, wrapping around as necessary,
thus distributing all of the UUID bits evenly across the ID.
Actual hash algorithms are in modules unavailable during early boot \(em this is loudly lamented in a comment.
The top bit is then discarded to prevent accidental false negatives by constructing
.Dv HW_INVALID_HOSTID
and potential sign extension
.Pq but this also means that the top bit of the 4th, 8th, 12th, and 16th bytes of the UUID don't contribute to the ID .
If this fails (or is skipped),
then the bottom 24 bits (except for bits 20 and 21, for no semantic reason)
of the Time Stamp Counter (TSC, which increases monotonically when the CPU is running)
are used as a "\(Fcrandom\(Fo" ID.
.Pp
If either of these methods worked, the ID is decimalised into
.Va hw_serial
.Pq which, curiously, is Xr ddi_strtoul 9F Ns ed on Em every No use .
.Pp
In the global zone, on
.Pf non- Tn SPARC ,
the host ID is saved to
.Pa /etc/hostid
(unless it already exists)
by the
.Nm hostid
service, which encodes
.Nm
output to the effect of
.Dl Ic echo Li \&"\e"\(Do( Ns Ic echo Li \&"0x\(Do( Ns Nm  Ns Li )" \&| Nm tr Li 'P-~!-O' '!-~')\e""
prepended with a scary
.Qq Li "# DO NOT EDIT"
comment.
.
.Ss Status quo \(em FreeBSD \fR[M2]\fP
.Fx Ns 's
.Brq Dv CTL_KERN , KERN_HOSTID
.Pq Qq Va kern.hostid
actually exposes the full
.Pq Vt unsigned
.Vt long
range to userspace, so 64-bit userlands on 64-bit kernels may set it to any 64-bit number.
Additionally, it grew
.Brq Dv CTL_KERN , KERN_HOSTUUID
.Pq Qq Va kern.hostuuid ,
which is a
.Sy 64 Ns -byte
.Pq Sy 63 No characters + NUL
string.
.Pp
These are initialised to
.Sy 0
and
.Sy \&"00000000-0000-0000-0000-000000000000" ,
respectively, but see below.
Jails may inherit them (otherwise they get the same initial values) at any granularity,
or they may be set via the
.Va host.host Ns Oo Va uu Oc Ns Va id
variables.
.Pp
If
.Va hostid_enable
is set in
.Pa /etc/rc.conf
(the default), then
.Pa /etc/rc/hostid
and
.Pa /etc/rc/hostid_save
run on boot, but not in a jail.
The former reads a line from
.Va hostid_file
.Pq Pa /etc/hostid No by default ,
validates it to make sure it's both in lower-case UUID format
.Pq additionaly rejecting broken UUIDs, like all-zero, last-12-bytes-all-one, Sy 1-2-3-4-5 , No &c.\& ,
and commits it to the sysctls \(em
.Va kern.hostuuid
verbatim, but
.Va kern.hostid
is the first four bytes of the MD5 hash of the UUID string (no newline) as a hexadecimal number.
.\" TODO: do we need a clarifier?
.\".Pq Li \&"0x\(Do( Ns Nm printf Li \(Do{ Ns Va kern.hostuuid Ns Li }\& \&| Nm md5 Li \&| Nm head Fl c Ar 8 Ns Li )" .
.Pp
If it fails validation, the same process is applied to the
.Va smbios.system.uuid
kernel environment variable set by the bootloader.
If that also fails validation, a warning about the situation is issued, boot halted for two seconds, and a fresh UUID is generated with
.Xr uuidgen 1 ,
and committed unconditionally.
.Pp
The "extra"
.Cm reset
command behaves as if
.Va hostid_file
failed validation,
then writes the UUID to
.Va hostid_file .
.Pp
The latter, dependency-ordered after the former, commits the current
.Va kern.hostuuid
to
.Va hostid_file
if it differs from its current contents.
.
.Ss Status quo \(em GNU \fR[M3]\fP
glibc comments Hurd
.Fn gethostid
as
.Dl "/* Return the current machine's Internet number.  */"
the comment in the body reads
.Bd -literal -compact -offset indent
  /* The hostid is just the contents of the file /etc/hostid,
     kept as text of hexadecimal digits.  */
  /* XXX this is supposed to come from the hardware serial number */
.Ed
.Pp
Conversely, the
.Fn sethostid
comment is
.Bd -literal -compact -offset indent
/* Set the current machine's Internet number to ID.
   This call is restricted to the super-user.  */
/* XXX […] isn't hostid supposed to be hardwired and unchangeable? */
.Ed
but the body comment
.Bd -literal -compact -offset indent
  /* The hostid is kept in the file /etc/hostid,
     eight characters of upper-case hexadecimal.  */
.Ed
.Pp
In a classic glibc moment, this indicates:
(a) confusion on the part of glibc authors with regards to what
.Va hostid
is,
(b) confusion on the part of glibc authors with regards to how they're storing it,
(c) confusion on the part of glibc authors with regards to what
.Va hostid
is supposed to be,
(d) confusion on the part of glibc authors with regards to what the standard says about
.Xr [gs]ethostid 3 ,
(e) confusion on the part of glibc authors with regards to
.Xr [gs]ethostid 3
prior art.
.
.Ss Status quo \(em glibc/Linux, uClibc[-ng]/Linux \fR[M4]\fP
Both do the same basic thing:
.Bl -bullet -compact -offset indent -width "@"
.It
Blit a 32-bit unsigned integer from
.Pa /etc/hostid ,
or
.It
Get the IPv4 address corresponding to the current hostname (if any),
do not decode it from network byte order,
swap the upper and lower 2-byte chunks ("to make it not look exactly like the IP"), or
.It
.Sy 0 .
.El
for reading and
blit a 32-bit unsigned integer into
.Pa /etc/hostid
(erroring if they failed to write all 4 bytes).
.Pp
This scheme (which glibc calls an "intelligent guess")
has a multitude of problems:
most hosts don't have an internet address,
the address corresponding to the hostname is very rarely the internet address
(any-more, at least, cf.\&
.Sx HISTORY , The BSD , Bx 4.3 ;
in a staggering moment of self-awareness, uClibc[-ng] comments that, indeed, this is usually the loopback address),
a staggering amount of hosts are IPv6-only.
On a little-endian platform, unless you're running
.Xr zfs 4 ,
it's therefore highly likely that your system's host ID is in fact
.Li 007f0101 .
.Pp
There is, as ever when dealing with glibc, a few minor devils in the minutiae; for
.Fn sethostid :
.Bl -bullet -compact -offset indent -width "@"
.It
glibc
.Er EPERM Ns s
if it's in its usual "secure" mode
.Pq cf. Xr secure_getenv 3 \(em it's SUID/SGID, has capabilities, or Dv AT_SECURE No was asserted in the auxiliary vector ,
uClibc[-ng] if either the real or effective UIDs aren't root;
.It
glibc
.Er EOVERFLOW Ns s
if the argument exceeds 32-bit limits;
.It
glibc
opens
.Pa /etc/hostid
.Dv O_TRUNC
in addition to
.Dv O_CREAT , 644
\(em even if the write fails, the ID is reset.
.El
.Pp
And for
.Fn gethostid :
.Bl -bullet -compact -offset indent -width "@"
.It
glibc
uses
.Pa /etc/hostid
if it read all 4 bytes,
uClibc[-ng]
even if it read just one;
.It
uClibc[-ng]
uses
.Xr getaddrinfo 3
with all-zero
.Fa hints
(so it may get results from any family),
and casts all addresses to
.Vt "struct sockaddr_in"
\(em if an IPv6 address is returned, it reads the
.Vt "struct sockaddr_in6"
.Pf always- Sy 0
.Fa sin6_flowinfo
field, residing at the same offset as the expected
.Fa sin_addr
field
.Pq cf. Xr ip 7 , Xr ipv6 7 ,
.It
glibc, on the other hand,
uses
.Xr gethostbyname_r 3 ,
querying only IPv4 addresses ex def.,
so if one wasn't found it returns a
.Sy 0
in the error path.
.El
So, in their equally byzantine ways, here at least they are exactly identical.
.\" TODO: my patch got applied, update this with the release it's released in
.\"       6d45c0fe89e6de7d35a991051ec7f9feaaaf3729
.
.Ss References
.ie n .Lk https://twitter.com/nabijaczleweli/status/1528864887954616321 [1]
.el   \{ \(S1
.Lk https://twitter.com/nabijaczleweli/status/1528864887954616321
.\}
.br
.ie n .Lk https://twitter.com/gedamore/status/1524961429794631680 [2]
.el   \{ \(S2
.Lk https://twitter.com/gedamore/status/1524961429794631680
.\}
.
.EQ
delim off
.EN

M man1/hostid.1.html => man1/hostid.1.html +744 -8
@@ 1,7 1,9 @@
<!DOCTYPE html>
<html>
<!-- This is an automatically generated file.  Do not edit.
   et
   SPDX-License-Identifier: 0BSD
   mandoc-ignore: WARNING: sections out of conventional order: Sh HISTORY
   -->
<head>
  <meta charset="utf-8"/>


@@ 34,25 36,759 @@
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">Prints the supposedly-unique identifier of the host, as obtained
<p class="Pp">Writes the supposedly-unique identifier of the host, as obtained
    via
    <a class="Xr" href="https://manpages.debian.org/bullseye/gethostid.3">gethostid(3)</a>,
    formatted as a zero-padded eight-character hexadecimal string.</p>
<p class="Pp">The
    <a class="Xr" href="https://manpages.debian.org/bullseye/gethostid.3">gethostid(3)</a>
    function has many inherent problems and varies wildly (or, indeed, not at
    all) across implementations; you should use neither it, nor
    <code class="Nm">hostid</code>.</p>
    formatted as a zero-padded eight-character hexadecimal string, followed by a
    newline, to the standard output stream.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
  ALSO</a></h1>
<p class="Pp"><a class="Xr" href="https://manpages.debian.org/bullseye/gethostid.3">gethostid(3)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="STANDARDS"><a class="permalink" href="#STANDARDS">STANDARDS</a></h1>
<p class="Pp">Compatible with SunOS 4 (Solaris).</p>
</section>
<section class="Sh">
<h1 class="Sh" id="CAVEATS"><a class="permalink" href="#CAVEATS">CAVEATS</a></h1>
<p class="Pp">The
    <a class="Xr" href="https://manpages.debian.org/bullseye/gethostid.3">gethostid(3)</a>
    function has many inherent problems and varies wildly across implementations
    and usually not at all across systems, and is not required to mean anything
    (cf. <a class="Sx" href="#HISTORY">HISTORY</a>,
    <a class="Sx" href="#Standards">Standards</a>,
    <span class="No">below</span>); you should use neither it, nor
    <code class="Nm">hostid</code> (which is, additionally, sparsely available,
    cf. <a class="Sx" href="#HISTORY">HISTORY</a>,
    <a class="Sx" href="#Status_quo">Status quo</a>,
    <span class="No">below</span>).</p>
<p class="Pp" id="some">There are
    <a class="permalink" href="#some"><i class="Em">some</i></a> useful ways of
    distinguishing hosts &#x2014; hostnames, at a small scale, the UUID in
    <span class="Pa">/etc/machine-id</span> (systemd
    <a class="Xr" href="https://manpages.debian.org/bullseye/machine-id.5">machine-id(5)</a>),
    the <var class="Va">kern.hostuuid</var> sysctl
    (<span class="Ux">FreeBSD</span>
    <a class="Xr" href="https://manpages.debian.org/bullseye/sysctl.3">sysctl(3)</a>),
    or one generated on package installation. <code class="Nm">hostid</code>
    isn't.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<section class="Ss">
<h2 class="Ss" id="The_BSD"><a class="permalink" href="#The_BSD">The
  BSD</a></h2>
<p class="Pp">Appeared in <span class="Ux">4.2BSD</span> (undocumented in
    <span class="Ux">4.1cBSD</span>, except
    <a class="Xr" href="https://manpages.debian.org/bullseye/gethostid.2">gethostid(2)</a>,
    with a single difference, noted below) as</p>
<div class="Bd Bd-indent">hostid - set or print identifier of current host
  system</div>
either <code class="Li">%x</code>-printing
  <a class="Xr" href="https://manpages.debian.org/bullseye/gethostid.2">gethostid(2)</a>,
  or, if specified, <code class="Li">%x</code>-parsing the first argument
  (<var class="Ar">identifier</var>), and passing it to
  <a class="Xr" href="https://manpages.debian.org/bullseye/sethostid.2">sethostid(2)</a>.
<p class="Pp">Both <a class="Xr" href="../man1/hostid.1.html">hostid(1)</a> and
    <a class="Xr" href="https://manpages.debian.org/bullseye/gethostid.2">gethostid(2)</a>
    reiterate that this &quot;32-bit identifier&quot; is &quot;intended to be
    unique among all UNIX systems in existence.&quot;, and is, per norm, a
    &quot;DARPA Internet address&quot; for the host. They also specify that the
    identifier is for the &quot;processor&quot;, which is a fun thought to
    consider, given that uniprocessor systems have been extinct for decades now
    (indeed, contemporary 3B2 <span class="No">systems were multiprocessor ex
    definitione</span>).</p>
<p class="Pp"><a class="Xr" href="https://manpages.debian.org/bullseye/gethostid.2">gethostid(2)</a>
    has a new-in-<span class="Ux">4.2BSD</span>
    <a class="Sx" href="#BUGS">BUGS</a> sexion declaring the retrospectively as
    obvious as had appeared between April and August of 1983:</p>
<div class="Bd Bd-indent">32 bits for the identifier is too small.</div>
<p class="Pp">The syscalls do exactly nothing except either returning a global
    <var class="Vt">long</var>
    <var class="Va">hostid</var><code class="Li">;</code>, or assigning to it if
    the caller is root (<code class="Er">EPERM</code>ing otherwise).</p>
<p class="Pp"><a class="Xr" href="../man1/hostid.1.html">hostid(1)</a> also
    specs that assignation is &quot;usually&quot; done in
    <span class="Pa">/etc/rc.local</span>, but the distribution startup scripts
    do not specify it (which would be impossible without another dedicated
    program to parse <span class="Pa">/etc/hosts</span>) or indicate that it
    should be inserted there. Similarly, the kernel doesn't use
    <var class="Va">hostid</var> at all (except for holding it), and the
    userland doesn't use
    <a class="Xr" href="https://manpages.debian.org/bullseye/[gs]ethostid.2">[gs]ethostid(2)</a>
    at all (except in <code class="Nm">hostid</code>); althugh
    <a class="Xr" href="https://manpages.debian.org/bullseye/getpid.2">getpid(2)</a>
    (since <span class="Ux">4.1cBSD</span>, but with a typo in the crossref)
    recommends it, proclaiming that it is most often &quot;used with the host
    identifier
    <a class="Xr" href="https://manpages.debian.org/bullseye/gethostid.2">gethostid(2)</a>
    to generate uniquely-named temporary files.&quot;.</p>
<p class="Pp" id="."><span class="Ux">4.3BSD</span> declares setting the host ID
    in <span class="Pa">/etc/rc.local</span> common, rather than the norm, and
    allows hostnames (the first address from
    <a class="Xr" href="https://manpages.debian.org/bullseye/gethostbyname.3N">gethostbyname(3N)</a>,
    if any), then dot-notation addressses via
    <a class="Xr" href="https://manpages.debian.org/bullseye/inet_addr.3N">inet_addr(3N)</a>
    (if the identifier contains a dot
    (&#x2018;<a class="permalink" href="#."><b class="Sy">.</b></a>&#x2019;)),
    both in host (little) byte order, then a hexadecimal number with an optional
    <b class="Sy">0x</b>/<a class="permalink" href="#0X"><b class="Sy" id="0X">0X</b></a>
    prefix; there's a usage string designating the argument &quot;hexnum or
    internet address&quot; if all the aforementioned methods fail, but the
    manual <a class="Sx" href="#SYNOPSIS">SYNOPSIS</a> is not updated (the
    <a class="Sx" href="#DESCRIPTION">DESCRIPTION</a> <span class="No">now says
    that a number or the hostname may be passed</span>). The no-argument output
    is <b class="Sy">0x</b>-prefixed
  (<code class="Li">%#x</code>-formatted).</p>
<p class="Pp">Thanks to this, the distribution
    <span class="Pa">/etc/rc.local</span> runs</p>
<div class="Bd Bd-indent"><code class="Li"><code class="Nm">hostid</code>
  <code class="Li">`</code><code class="Nm">hostname</code><code class="Li">`</code></code></div>
but the only other new user is the
  <a class="Xr" href="https://manpages.debian.org/bullseye/hunt.6">hunt(6)</a>
  driver, using
  <a class="Xr" href="https://manpages.debian.org/bullseye/gethostid.2">gethostid(2)</a>
  as the player's machine if configured for playing in the
  <code class="Dv">UNIX</code> domain (otherwise, in the
  <code class="Dv">INTERNET</code> domain, it's the calling peer's address in
  host byte order), and the
  <a class="Xr" href="https://manpages.debian.org/bullseye/getpid.2">getpid(2)</a>
  recommendation disappears.
  <a class="Xr" href="https://manpages.debian.org/bullseye/[gs]ethostid.2">[gs]ethostid(2)</a>
  also return/take <var class="Vt">long</var>s &#x2014; both are 4 bytes on the
  ILP32 VAX, the only potential reasoning for this would be overfitting to the
  ARPA network long (4 bytes), as opposed to the network short (2 bytes); it is,
  nonetheless, inexplicable.
<p class="Pp"><span class="Ux">4.3BSD-Tahoe</span> propagates the synopsis
    change to the <a class="Sx" href="#SYNOPSIS">SYNOPSIS</a>, and the
    <a class="Xr" href="https://manpages.debian.org/bullseye/[gs]ethostid.2">[gs]ethostid(2)</a>
    types to the formatting/parsing specifiers as
    <code class="Li">%#lx</code>/<code class="Li">%lx</code>. It also,
    unrelatedly, moves network initalisation, including the
    <code class="Nm">hostid</code> call-site, to
    <span class="Pa">/etc/netstart</span>.</p>
<p class="Pp">Networking Release 2 (Net/2) omits <code class="Nm">hostid</code>,
    with the only user of
    <a class="Xr" href="https://manpages.debian.org/bullseye/gethostid.2">gethostid(2)</a>
    being as part of the salt for random DES key generation in libdes
    (<a class="Xr" href="https://manpages.debian.org/bullseye/des_crypt.3">des_crypt(3)</a>)
    (the only part of MIT <span class="No">Kerberos 4 in the
    distribution</span>), and no
    <a class="Xr" href="https://manpages.debian.org/bullseye/sethostid.2">sethostid(2)</a>
    callers.</p>
<p class="Pp" id="sysctl"><span class="Ux">4.4BSD</span> sees
    <code class="Nm">hostid</code>, unchanged, in
    <span class="Pa">/usr/old</span> (as opposed to <span class="Pa">/bin</span>
    <span class="No">in previous releases</span>), and
    <a class="Xr" href="https://manpages.debian.org/bullseye/[gs]ethostid.3">[gs]ethostid(3)</a>
    as <span class="Lb">Standard C&#x00A0;Library (libc, -lc)</span> shims in
    the <span class="Pa">compat-43</span> subdirectory &#x2014; deprecated in
    favour of, and implemented in terms of, the
    new-in-<span class="Ux">4.4BSD</span>
    <a class="permalink" href="#sysctl"><b class="Sy">sysctl</b></a> mechanism
    (documented as
    <a class="Xr" href="https://manpages.debian.org/bullseye/sysctl.2">sysctl(2)</a>,
    but actually
    <a class="Xr" href="https://manpages.debian.org/bullseye/sysctl.3">sysctl(3)</a>)
    under the {<code class="Dv">CTL_KERN</code>,
    <code class="Dv">KERN_HOSTID</code>}
    (&quot;<var class="Va">kern.hostid</var>&quot; symbolic
    <a class="Xr" href="https://manpages.debian.org/bullseye/sysctl.8">sysctl(8)</a>)
    name, documented as &quot;Get or set the host id.&quot;. The syscalls are
    likewise retained for compatibility (but only if
    <code class="Dv">COMPAT_43</code> (<code class="Fn">osethostid</code>()) or
    either <code class="Dv">COMPAT_43</code> <span class="No">or</span>
    <code class="Dv">COMPAT_SUNOS</code>, <span class="No">as part of SunOS
    emulation</span> (<code class="Fn">ogethostid</code>()) is defined at
    build-time), but renamed to
    <code class="Dv">SYS_o</code>[<code class="Dv">gs</code>]<code class="Dv">ethostid</code>.
    <var class="Va">hostid</var> is initialised (other than the
    <b class="Sy">0</b> <span class="No">default</span>) on the SPARC (Sun-4c)
    port, attempting compatibility with SunOS &#x2014; from the ID PROM residing
    in the Mostek MK48T02 time-of-day clock device's MMIO area (or, from the
    FORTH PROM perspective, the &quot;eeprom&quot; device's, that also happens
    to contain the clock, MMIO area), with the highest byte being the machine
    type, the middle two bytes being the first two bytes of the 3-byte host ID
    field, and the lowest byte also being the first byte.</p>
<p class="Pp"><span class="Ux">4.4BSD-Lite</span> drops
    <code class="Nm">hostid</code> entirely.</p>
<p class="Pp"><span class="Ux">4.4BSD-Lite2</span> fixes
    <var class="Va">hostid</var> initialisation by assigning the final byte of
    the host ID PROM field to the lowest byte, finally achieving compatibility
    with SunOS and renames all <code class="Li">o</code>(ld)-prefixed syscalls
    to be <code class="Li">compat_43_</code>-prefixed instead.</p>
<p class="Pp">This leaves the <span class="Ux">BSD</span> at exactly two users,
    ever, being part of the distribution:
    <a class="Xr" href="https://manpages.debian.org/bullseye/hunt.6">hunt(6)</a>
    and MIT Kerberos 4 libdes.</p>
</section>
<section class="Ss">
<h2 class="Ss" id="SunOS"><a class="permalink" href="#SunOS">SunOS</a></h2>
<p class="Pp">The <span class="Ux">4.2BSD</span>-based SunOS carries its
    <code class="Nm">hostid</code> and
    <a class="Xr" href="https://manpages.debian.org/bullseye/gethostid.2">gethostid(2)</a>,
    but removes <code class="Fn">sethostid</code>() &#x2014;
    <a class="Xr" href="../man1/hostid.1.html">hostid(1)</a> says simply
  that</p>
<div class="Bd Bd-indent">This numeric value is unique across all hosts.</div>
and
  <a class="Xr" href="https://manpages.debian.org/bullseye/gethostid.2">gethostid(2)</a>
  is much less verbose (and <a class="Sx" href="#BUGS">BUGS</a>-free), saying
  only that the 32-bit identifier is likewise &quot;unique across all
  hosts&quot;.
<p class="Pp">SunOS 2 actually removes the
    <a class="Xr" href="https://manpages.debian.org/bullseye/sethostid.2">sethostid(2)</a>
    syscall and clarifies in
    <a class="Xr" href="../man1/hostid.1.html">hostid(1)</a> that the value is
    unique &quot;across all <i>Sun</i> hosts&quot; (font change original), but
    in
    <a class="Xr" href="https://manpages.debian.org/bullseye/gethostid.2">gethostid(2)</a>
    that it just &quot;should be&quot; unique, and clarifies, that</p>
<div class="Bd Bd-indent">On the Sun, this number is taken from the CPU board's
  ID PROM.</div>
<p class="Pp">Save for minor maturing formatting choices (including a non-italic
    &quot;Sun&quot;), the only real difference comes in
    <span class="Ux">4.3BSD</span>-derived SunOS 4 (Solaris) whose
    <code class="Nm">hostid</code> formats
    <a class="Xr" href="https://manpages.debian.org/bullseye/gethostid.2">gethostid(2)</a>
    (now decelestialised to &quot;a Sun workstation&quot;) as
    <code class="Li">%08x</code> (the same as this implementation!). Therein
    also lies the first user in the distribution:
    <a class="Xr" href="https://manpages.debian.org/bullseye/snap.1">snap(1)</a>
    via list of hosts to administer in
    <a class="Xr" href="https://manpages.debian.org/bullseye/systems.5">systems(5)</a>
    (although, respectively: only available on &quot;Sun 386i systems&quot;
    running SunOS 4.0, removed in SunOS 4.1; optional, empty by default),
    explicitly specifying the <code class="Nm">hostid</code> output format.</p>
<p class="Pp" id="User_Diag">Predictably, most binaries distributed in the
    <a class="permalink" href="#User_Diag"><b class="Sy">User_Diag</b></a>
    package use
    <a class="Xr" href="https://manpages.debian.org/bullseye/gethostid.2">gethostid(2)</a>.
    OpenWindows uses it in a few places, most notably (as its inetd server
    <a class="Xr" href="https://manpages.debian.org/bullseye/ttdbserverd.8">ttdbserverd(8)</a>
    (<code class="Nm">rpc.ttdbserverd</code>) is in the
    <a class="permalink" href="#usr"><b class="Sy" id="usr">usr</b></a>
    <span class="No">package</span>) for the ToolTalk database.</p>
</section>
<section class="Ss">
<h2 class="Ss" id="System_V"><a class="permalink" href="#System_V">System
  V</a></h2>
<p class="Pp"><span class="Ux">AT&amp;T System&#x00A0;V Release&#x00A0;4
    UNIX</span> (x86), as part of the <span class="Ux">4.3BSD</span> merge,
    includes a new
    <a class="Xr" href="https://manpages.debian.org/bullseye/sysinfo.2">sysinfo(2)</a>
    syscall for returning data as strings; some already available as part of
    <a class="Xr" href="https://manpages.debian.org/bullseye/uname.2">uname(2)</a>
    (<code class="Dv">SI_SYSNAME</code>, <code class="Dv">SI_HOSTNAME</code>,
    <code class="Dv">SI_RELEASE</code>, <code class="Dv">SI_VERSION</code>,
    <code class="Dv">SI_MACHINE</code>), with the hostname now newly settable
    via <code class="Dv">SI_SET_HOSTNAME</code> (&quot;unpublished&quot; despite
    being in the header) &#x2014; the only official interface being
    <code class="Fn">sethostid</code>() as part of libucb
    (&quot;<code class="Li">ucblibc</code>&quot;) in the
    <b class="Sy">compat</b> package (the &quot;BSD compatibility
    package&quot;).</p>
<p class="Pp" id="40">Likewise, therein resides
    <code class="Fn">gethostid</code>(), parsing the result of
    <code class="Dv">SI_HW_SERIAL</code> &#x2014; the <var class="Vt">char</var>
    <var class="Va">hw_serial</var><var class="Vt">[]</var><code class="Li">;</code>
    kernel variable, assigned from the <code class="Dv">HW_SERIAL</code> macro
    <code class="Li">&quot;0&quot;</code> &#x2014; as
    <code class="Li">%12x</code> (despite (a) the buffer size being
    <code class="Dv">HOSTIDLEN</code>
    (<a class="permalink" href="#40"><b class="Sy">40</b></a>) and (b)
    <a class="permalink" href="#12"><b class="Sy" id="12">12</b></a>
    <span class="No">not matching any reasonable limit</span>
    (<b class="Sy">8</b> <span class="No">for</span> <code class="Li">%x</code>,
    <b class="Sy">10</b> <span class="No">for</span> <code class="Li">%d</code>,
    <b class="Sy">11</b> <span class="No">for</span>
    <code class="Li">%o</code>)) and <code class="Fn">printf</code>()s
    <code class="Li">&quot;name = %s&quot;</code> the result beforehand.</p>
<p class="Pp"><span class="Pa">/usr/ucb/</span><code class="Nm">hostid</code>,
    also relegated to the package, just <code class="Fn">printf</code>()s the
    <code class="Nm">sysinfo</code> (<code class="Dv">SI_HW_SERIAL</code>)
    output (although with a 256-byte buffer).</p>
<p class="Pp">The 3B2 port defines <code class="Dv">HW_SERIAL</code> to
    <code class="Li">&quot;serial number&quot;</code> (and doesn't ship the
    <b class="Sy">compat</b> <span class="No">package</span>) &#x2014; this is
    not a respected API on AT&amp;T's part.</p>
</section>
<section class="Ss">
<h2 class="Ss" id="SunOS_(again)"><a class="permalink" href="#SunOS_(again)">SunOS
  (again)</a></h2>
<p class="Pp">SunOS 5 (Solaris 2), now based on <span class="Ux">AT&amp;T
    System&#x00A0;V Release&#x00A0;4 UNIX</span>, inherits its
    <a class="Xr" href="https://manpages.debian.org/bullseye/sysinfo.2">sysinfo(2)</a>;
    libucb (&quot;<code class="Li">ucblibc</code>&quot;)
    <code class="Fn">gethostid</code>() is fixed (by removing the
    <code class="Fn">printf</code>(), parsing with
    <code class="Fn">strtoul</code>() in explicit base-<b class="Sy">10</b>,
    handling the parse error, if any (returning <b class="Sy">-1</b>,
    <span class="No">later dubbed</span>
    <code class="Dv">HW_INVALID_HOSTID</code>), and likewise returning
    <b class="Sy">-1</b> for an ID of <b class="Sy">0</b>).</p>
<p class="Pp" id="also">However, <span class="Lb">Standard C&#x00A0;Library
    (libc, -lc)</span>
    <a class="permalink" href="#also"><i class="Em">also</i></a> carries a
    <a class="Xr" href="https://manpages.debian.org/bullseye/gethostid.3">gethostid(3)</a>
    implementation, which is both entirely unrelated and entirely identical
    (except that it uses a slightly bigger buffer, which doesn't matter, since
    <var class="Va">hw_serial</var> is <b class="Sy">11</b>
    <var class="Vt">char</var>s
  <math class="eqn">
    <mrow><mo>(</mo><msup><mn>2</mn><mn>32</mn></msup></mrow>
  </math>
   + NUL) long and the additional byte's space in the receiving buffer is not
    passed to
    <a class="Xr" href="https://manpages.debian.org/bullseye/sysinfo.2">sysinfo(2)</a>
    and doesn't return an error for an ID of <b class="Sy">0</b>).</p>
<p class="Pp"><code class="Nm">hostid</code> also prints an error (&quot;bad
    hostid format&quot;) and exits <b class="Sy">1</b> if
    <a class="Xr" href="https://manpages.debian.org/bullseye/gethostid.3">gethostid(3)</a>
    returns <b class="Sy">-1</b>, i.e. if the
    <a class="Xr" href="https://manpages.debian.org/bullseye/sysinfo.2">sysinfo(2)</a>
    call fails, which it can't, but is otherwise equivalent to SunOS 4
    (Solaris)'.</p>
<p class="Pp">For all SPARC (Sun-4, SPARC V9) platforms the scheme is the same
    as in <span class="Ux">4.4BSD</span> (unsurprisingly), although expressed
    much more succinctly as</p>
<div class="Bd Bd-indent"><code class="Li">idprom.id_machine &lt;&lt; 24 +
  idprom.id_serial</code></div>
because SPARC (Sun-4) is big-endian. The capitalisation du jour appears to be
  &quot;IDprom&quot;. For Intel platforms (x86, IA64),
  <var class="Va">hw_serial</var> (among <var class="Va">hw_provider</var>
  (<code class="Dv">SI_HW_PROVIDER</code>) &amp;al.) is supposed to be
  initialised by the bootloader from <span class="Pa">/etc/bootrc</span>
  &#x2014; said code
  <a class="permalink" href="#does"><i class="Em" id="does">does</i></a> exist
  for the hostname (by specifying <code class="Li">setprop si-machine</code>
  <var class="Ar">the-hostname</var>) and <var class="Va">hw_provider</var>
  (<code class="Li">si-hw-provider</code>) &#x2014; but the only way
  <var class="Va">hw_serial</var> is changed from its
  <code class="Li">&quot;0&quot;</code> initialiser on x86 is by loading, then
  immediately unloading, the <span class="Pa">misc/sysinit</span> module which
  takes a lot of complicated-looking math and a manual
  <code class="Fn">sprintf</code>(<var class="Fa">%u</var>) implementation to
  also write the constant <code class="Li">&quot;0&quot;</code> via the
  <var class="Va">_hs1107</var> DDI-workaround symbol. Yes&#x00B9;.
  Reportedly&#x00B2;, some SunOS distributors provide their own module. COMPAQ,
  as a vendor, is additionally autodetected on x86 by matching on
  <code class="Li">&quot;COMPAQ&quot;</code> at a magic address and setting
  <var class="Va">hw_provider</var> <code class="Li">&quot;COMPAQ&quot;</code>.
<p class="Pp">The only users of
    <a class="Xr" href="https://manpages.debian.org/bullseye/gethostid.3">gethostid(3)</a>
    in the distribution are <code class="Nm">in.ndpd</code> (Neighbor Discovery
    for IPv6, RFC2461), if any non-loopback IPv6 interface exists,
    <code class="Nm">in.ripngd</code> (Routing Information Protocol for IPv6,
    RFC2080), if the host is an IPv6 router, and
    <code class="Nm">in.rdisc</code> (ICMP Router Discovery Protocol, RFC1256),
    if the host is an IPv4 router. All of them use it exactly once and exactly
    in the same way: by calling</p>
<div class="Bd
  Bd-indent"><code class="Nm">srandom</code><code class="Li">(</code><code class="Nm">gethostid</code><code class="Li">());</code></div>
</section>
<section class="Ss">
<h2 class="Ss" id="Standards"><a class="permalink" href="#Standards">Standards</a></h2>
<p class="Pp"><span class="St">X/Open Portability Guide Issue&#x00A0;4,
    Version&#x00A0;2 (&#x201C;XPG4.2&#x201D;)</span> includes
    <code class="Fn">gethostid</code>() as an X/OPEN UNIX
    <span class="No">Extension</span>; the migration guide describes it
    succinctly:</p>
<div class="Bd Bd-indent">The <code class="Fn">gethostid</code>() function
  retrieves a 32-bit identifier for the current host. X/Open does not define the
  domain in which the return value is unique.</div>
<p class="Pp"><span class="St">Version&#x00A0;2 of the Single UNIX Specification
    (&#x201C;SUSv2&#x201D;)</span> moves it to BASE, as an X/Open Systems
    Interfaces (XSI) extension to the C standards,</p>
</section>
<section class="Ss">
<h2 class="Ss" id="Status_quo"><a class="permalink" href="#Status_quo">Status
  quo</a></h2>
<table class="tbl">
  <tr style="border-bottom-style: solid;">
    <td><b>Platform</b></td>
    <td><b>Flags</b></td>
    <td><b>API</b></td>
    <td><b>Source</b></td>
    <td><b>Notes</b></td>
  </tr>
  <tr>
    <td>illumos/SPARC</td>
    <td><b>khx</b></td>
    <td>SunOS</td>
    <td>SPARC ID PROM</td>
    <td>Can be configured per-zone</td>
  </tr>
  <tr>
    <td>illumos/x86</td>
    <td><b>kxp</b></td>
    <td>SunOS</td>
    <td>[M1]</td>
    <td>(likewise)</td>
  </tr>
  <tr>
  </tr>
  <tr>
    <td>NetBSD/SPARC</td>
    <td><b>khs</b></td>
    <td>4.4BSD</td>
    <td>SPARC ID PROM</td>
  </tr>
  <tr>
    <td>NetBSD/newsmips</td>
    <td><b>khs</b></td>
    <td>4.4BSD</td>
    <td>ID ROM</td>
    <td>4-byte serial field</td>
  </tr>
  <tr>
    <td>NetBSD/news68k</td>
    <td><b>ks</b></td>
    <td>4.4BSD</td>
    <td colspan="2">Likewise (2-byte on the 1[4567]00), but not exported to
      <i>hostid</i></td>
  </tr>
  <tr>
    <td>NetBSD/Amiga</td>
    <td><b>khs</b></td>
    <td>4.4BSD</td>
    <td colspan="2">Serial of DraCo workstation, stored on battery-backed RTC
      (drbbc(4))</td>
  </tr>
  <tr>
    <td>NetBSD </td>
    <td><b>ks</b></td>
    <td>4.4BSD</td>
    <td>None; <b>0</b></td>
    <td><span class="Li">SYS_compat_43_o</span>[<span class="Li">gs</span>]<span class="Li">ethostid</span>
      supported</td>
  </tr>
  <tr>
  </tr>
  <tr>
    <td>OpenBSD/SPARC64</td>
    <td><b>khs</b></td>
    <td>4.4BSD</td>
    <td>SPARC ID PROM</td>
  </tr>
  <tr>
    <td>OpenBSD </td>
    <td><b>ks</b></td>
    <td>4.4BSD</td>
    <td>None; <b>0</b></td>
  </tr>
  <tr>
  </tr>
  <tr>
    <td>FreeBSD</td>
    <td><b>ksp</b></td>
    <td>4.4BSD</td>
    <td>[M2]</td>
    <td>Private per-jail; supports old syscalls</td>
  </tr>
  <tr>
    <td>(glibc/kFreeBSD)</td>
    <td><b></b></td>
    <td></td>
    <td></td>
    <td>(if configured with <span class="Li">COMPAT_43</span>), no
      <span class="Li">SYS_</span> macros</td>
  </tr>
  <tr>
  </tr>
  <tr>
    <td>GNU</td>
    <td><b>spx</b></td>
    <td></td>
    <td><i>/etc/hostid</i></td>
    <td>[M3]</td>
  </tr>
  <tr>
  </tr>
  <tr>
    <td>glibc/Linux</td>
    <td><b>spx</b></td>
    <td></td>
    <td>[M4]</td>
    <td>All userlands provide a compatible
      <span class="Li"><b>hostid</b></span></td>
  </tr>
  <tr>
    <td>musl/Linux</td>
    <td><b>x</b></td>
    <td></td>
    <td>None; <b>0</b></td>
    <td>(likewise)</td>
  </tr>
  <tr>
    <td>uClibc[-ng]/Linux</td>
    <td><b>spx</b></td>
    <td></td>
    <td>[M4]</td>
    <td>(likewise); <b>sethostid</b>() only if <span class="Li">USE_BSD</span>
      (the default)</td>
  </tr>
  <tr>
    <td>dietlibc/Linux</td>
    <td><b></b></td>
    <td></td>
    <td>N/A</td>
  </tr>
  <tr>
    <td>Bionic/Linux</td>
    <td><b></b></td>
    <td></td>
    <td>N/A</td>
    <td><span class="Li">in_posix_and_glibc_but_actually_dead</span></td>
  </tr>
  <tr>
  </tr>
  <tr>
    <td style="text-align: right;">Legend:</td>
    <td style="text-align: right;"><b>k</b></td>
    <td colspan="3">stored in the kernel</td>
  </tr>
  <tr>
    <td style="text-align: right;"></td>
    <td style="text-align: right;"><b>h</b></td>
    <td colspan="3">hardware-derived</td>
  </tr>
  <tr>
    <td style="text-align: right;"></td>
    <td style="text-align: right;"><b>s</b></td>
    <td colspan="3">can be set</td>
  </tr>
  <tr>
    <td style="text-align: right;"></td>
    <td style="text-align: right;"><b>p</b></td>
    <td colspan="3">persisted in userspace</td>
  </tr>
  <tr>
    <td style="text-align: right;"></td>
    <td style="text-align: right;"><b>x</b></td>
    <td colspan="3">has hostid(1)</td>
  </tr>
</table>
</section>
<section class="Ss">
<h2 class="Ss">Status quo &#x2014; illumos/x86 [M1]</h2>
<p class="Pp">During kernel startup, <span class="Pa">/etc/hostid</span> is
    opened; if that succeeds, it's lexed as a series of system config file
    (newline-delimited, whitespace-insignificant,
    <a class="permalink" href="#_"><b class="Sy" id="_">#</b></a>-commented,
    typed text, strings
    <a class="permalink" href="#__"><b class="Sy" id="__">&quot;&quot;</b></a>-wrapped;
    <a class="Xr" href="https://manpages.debian.org/bullseye/system.5">system(5)</a>)
    strings, each decoded from ROT47, parsed again as a system config file
    number (case-insensitive, <b class="Sy">-</b>,
    <a class="permalink" href="#_~2"><b class="Sy" id="_~2">~</b></a>
    <span class="No">operators for negation and bitwise inversion, automatic
    base detection between</span> <b class="Sy">8</b>, <b class="Sy">10</b>,
    <span class="No">and</span>
    <a class="permalink" href="#16"><b class="Sy" id="16">16</b></a>
    <span class="No">from prefix</span>), the final valid of which wins (with
    invalid numbers warned about). If no valid numbers exist (or the final one
    was the aforementioned <code class="Dv">HW_INVALID_HOSTID</code>
    <span class="No">(all bits set), used as an initialiser</span>) a warning is
    issued about the file being corrupt, and <var class="Va">hw_serial</var> is
    unchanged
    (<a class="permalink" href="#_0_"><b class="Sy" id="_0_">&quot;0&quot;</b></a>).
    Following that, another warning is issued about the inability to set the
    host ID.</p>
<p class="Pp">If it doesn't, then the legacy
    <span class="Pa">misc/sysinit</span> module is loaded, which, if succeeds,
    is followed by parsing <var class="Va">hw_serial</var>. If it fails, and the
    system has a non-disabled SMBIOS, then its UUID is used, but not if it's
    all-zeroes, all-ones, or another known-bad value (in which case this step is
    skipped with a warning to &quot;Contact BIOS manufacturer for repair.&quot;
    (as if!)). The host ID is initialised to <b class="Sy">0</b>, then
    consecutive bytes of the UUID XORed with consecutive bytes thereof, starting
    with the least significant, wrapping around as necessary, thus distributing
    all of the UUID bits evenly across the ID. Actual hash algorithms are in
    modules unavailable during early boot &#x2014; this is loudly lamented in a
    comment. The top bit is then discarded to prevent accidental false negatives
    by constructing <code class="Dv">HW_INVALID_HOSTID</code> and potential sign
    extension (but this also means that the top bit of the 4th, 8th, 12th, and
    16th bytes of the UUID don't contribute to the ID). If this fails (or is
    skipped), then the bottom 24 bits (except for bits 20 and 21, for no
    semantic reason) of the Time Stamp Counter (TSC, which increases
    monotonically when the CPU is running) are used as a
    &quot;&#x00BB;random&#x00AB;&quot; ID.</p>
<p class="Pp" id="every">If either of these methods worked, the ID is
    decimalised into <var class="Va">hw_serial</var> (which, curiously, is
    <a class="Xr" href="https://manpages.debian.org/bullseye/ddi_strtoul.9F">ddi_strtoul(9F)</a>ed
    on <a class="permalink" href="#every"><i class="Em">every</i></a>
    <span class="No">use</span>).</p>
<p class="Pp">In the global zone, on non-SPARC, the host ID is saved to
    <span class="Pa">/etc/hostid</span> (unless it already exists) by the
    <code class="Nm">hostid</code> service, which encodes
    <code class="Nm">hostid</code> output to the effect of</p>
<div class="Bd Bd-indent"><code class="Li"><code class="Ic">echo</code>
  <code class="Li">&quot;\&quot;$(</code><code class="Ic">echo</code>
  <code class="Li">&quot;0x$(</code><code class="Nm">hostid</code><code class="Li">)&quot;
  |</code> <code class="Nm">tr</code> <code class="Li">'P-~!-O'
  '!-~')\&quot;&quot;</code></code></div>
prepended with a scary &quot;<code class="Li"># DO NOT EDIT</code>&quot;
  comment.
</section>
<section class="Ss">
<h2 class="Ss">Status quo &#x2014; FreeBSD [M2]</h2>
<p class="Pp"><span class="Ux">FreeBSD</span>'s
    {<code class="Dv">CTL_KERN</code>, <code class="Dv">KERN_HOSTID</code>}
    (&quot;<var class="Va">kern.hostid</var>&quot;) actually exposes the full
    (<var class="Vt">unsigned</var>) <var class="Vt">long</var> range to
    userspace, so 64-bit userlands on 64-bit kernels may set it to any 64-bit
    number. Additionally, it grew {<code class="Dv">CTL_KERN</code>,
    <code class="Dv">KERN_HOSTUUID</code>}
    (&quot;<var class="Va">kern.hostuuid</var>&quot;), which is a
    <a class="permalink" href="#64"><b class="Sy" id="64">64</b></a>-byte
    (<a class="permalink" href="#63"><b class="Sy" id="63">63</b></a>
    <span class="No">characters + NUL</span>) string.</p>
<p class="Pp" id="_00000000-0000-0000-0000-000000000000_">These are initialised
    to <b class="Sy">0</b> and
    <a class="permalink" href="#_00000000-0000-0000-0000-000000000000_"><b class="Sy">&quot;00000000-0000-0000-0000-000000000000&quot;</b></a>,
    respectively, but see below. Jails may inherit them (otherwise they get the
    same initial values) at any granularity, or they may be set via the
    <var class="Va">host.host</var>[<var class="Va">uu</var>]<var class="Va">id</var>
    variables.</p>
<p class="Pp" id="1-2-3-4-5">If <var class="Va">hostid_enable</var> is set in
    <span class="Pa">/etc/rc.conf</span> (the default), then
    <span class="Pa">/etc/rc/hostid</span> and
    <span class="Pa">/etc/rc/hostid_save</span> run on boot, but not in a jail.
    The former reads a line from <var class="Va">hostid_file</var>
    (<span class="Pa">/etc/hostid</span> <span class="No">by default</span>),
    validates it to make sure it's both in lower-case UUID format (additionaly
    rejecting broken UUIDs, like all-zero, last-12-bytes-all-one,
    <a class="permalink" href="#1-2-3-4-5"><b class="Sy">1-2-3-4-5</b></a>,
    <span class="No">&amp;c.</span>), and commits it to the sysctls &#x2014;
    <var class="Va">kern.hostuuid</var> verbatim, but
    <var class="Va">kern.hostid</var> is the first four bytes of the MD5 hash of
    the UUID string (no newline) as a hexadecimal number.</p>
<p class="Pp">If it fails validation, the same process is applied to the
    <var class="Va">smbios.system.uuid</var> kernel environment variable set by
    the bootloader. If that also fails validation, a warning about the situation
    is issued, boot halted for two seconds, and a fresh UUID is generated with
    <a class="Xr" href="https://manpages.debian.org/bullseye/uuidgen.1">uuidgen(1)</a>,
    and committed unconditionally.</p>
<p class="Pp">The &quot;extra&quot; <code class="Cm">reset</code> command
    behaves as if <var class="Va">hostid_file</var> failed validation, then
    writes the UUID to <var class="Va">hostid_file</var>.</p>
<p class="Pp">The latter, dependency-ordered after the former, commits the
    current <var class="Va">kern.hostuuid</var> to
    <var class="Va">hostid_file</var> if it differs from its current
  contents.</p>
</section>
<section class="Ss">
<h2 class="Ss">Status quo &#x2014; GNU [M3]</h2>
<p class="Pp">glibc comments Hurd <code class="Fn">gethostid</code>() as</p>
<div class="Bd Bd-indent"><code class="Li">/* Return the current machine's
  Internet number. */</code></div>
the comment in the body reads
<div class="Bd Bd-indent Li">
<pre>  /* The hostid is just the contents of the file /etc/hostid,
     kept as text of hexadecimal digits.  */
  /* XXX this is supposed to come from the hardware serial number */</pre>
</div>
<p class="Pp">Conversely, the <code class="Fn">sethostid</code>() comment is</p>
<div class="Bd Bd-indent Li">
<pre>/* Set the current machine's Internet number to ID.
   This call is restricted to the super-user.  */
/* XXX [&#x2026;] isn't hostid supposed to be hardwired and unchangeable? */</pre>
</div>
but the body comment
<div class="Bd Bd-indent Li">
<pre>  /* The hostid is kept in the file /etc/hostid,
     eight characters of upper-case hexadecimal.  */</pre>
</div>
<p class="Pp">In a classic glibc moment, this indicates: (a) confusion on the
    part of glibc authors with regards to what <var class="Va">hostid</var> is,
    (b) confusion on the part of glibc authors with regards to how they're
    storing it, (c) confusion on the part of glibc authors with regards to what
    <var class="Va">hostid</var> is supposed to be, (d) confusion on the part of
    glibc authors with regards to what the standard says about
    <a class="Xr" href="https://manpages.debian.org/bullseye/[gs]ethostid.3">[gs]ethostid(3)</a>,
    (e) confusion on the part of glibc authors with regards to
    <a class="Xr" href="https://manpages.debian.org/bullseye/[gs]ethostid.3">[gs]ethostid(3)</a>
    prior art.</p>
</section>
<section class="Ss">
<h2 class="Ss">Status quo &#x2014; glibc/Linux, uClibc[-ng]/Linux [M4]</h2>
<p class="Pp">Both do the same basic thing:</p>
<ul class="Bl-bullet Bd-indent Bl-compact">
  <li>Blit a 32-bit unsigned integer from <span class="Pa">/etc/hostid</span>,
      or</li>
  <li>Get the IPv4 address corresponding to the current hostname (if any), do
      not decode it from network byte order, swap the upper and lower 2-byte
      chunks (&quot;to make it not look exactly like the IP&quot;), or</li>
  <li id="0"><a class="permalink" href="#0"><b class="Sy">0</b></a>.</li>
</ul>
for reading and blit a 32-bit unsigned integer into
  <span class="Pa">/etc/hostid</span> (erroring if they failed to write all 4
  bytes).
<p class="Pp">This scheme (which glibc calls an &quot;intelligent guess&quot;)
    has a multitude of problems: most hosts don't have an internet address, the
    address corresponding to the hostname is very rarely the internet address
    (any-more, at least, cf. <a class="Sx" href="#HISTORY">HISTORY</a>,
    <a class="Sx" href="#The_BSD">The BSD</a>, <span class="Ux">4.3BSD</span>;
    in a staggering moment of self-awareness, uClibc[-ng] comments that, indeed,
    this is usually the loopback address), a staggering amount of hosts are
    IPv6-only. On a little-endian platform, unless you're running
    <a class="Xr" href="https://manpages.debian.org/bullseye/zfs.4">zfs(4)</a>,
    it's therefore highly likely that your system's host ID is in fact
    <code class="Li">007f0101</code>.</p>
<p class="Pp">There is, as ever when dealing with glibc, a few minor devils in
    the minutiae; for <code class="Fn">sethostid</code>():</p>
<ul class="Bl-bullet Bd-indent Bl-compact">
  <li>glibc <code class="Er">EPERM</code>s if it's in its usual
      &quot;secure&quot; mode (cf.
      <a class="Xr" href="https://manpages.debian.org/bullseye/secure_getenv.3">secure_getenv(3)</a>
      &#x2014; it's SUID/SGID, has capabilities, or
      <code class="Dv">AT_SECURE</code> <span class="No">was asserted in the
      auxiliary vector</span>), uClibc[-ng] if either the real or effective UIDs
      aren't root;</li>
  <li>glibc <code class="Er">EOVERFLOW</code>s if the argument exceeds 32-bit
      limits;</li>
  <li>glibc opens <span class="Pa">/etc/hostid</span>
      <code class="Dv">O_TRUNC</code> in addition to
      <code class="Dv">O_CREAT</code>, <code class="Dv">644</code> &#x2014; even
      if the write fails, the ID is reset.</li>
</ul>
<p class="Pp">And for <code class="Fn">gethostid</code>():</p>
<ul class="Bl-bullet Bd-indent Bl-compact">
  <li>glibc uses <span class="Pa">/etc/hostid</span> if it read all 4 bytes,
      uClibc[-ng] even if it read just one;</li>
  <li>uClibc[-ng] uses
      <a class="Xr" href="https://manpages.debian.org/bullseye/getaddrinfo.3">getaddrinfo(3)</a>
      with all-zero <var class="Fa">hints</var> (so it may get results from any
      family), and casts all addresses to <var class="Vt">struct
      sockaddr_in</var> &#x2014; if an IPv6 address is returned, it reads the
      <var class="Vt">struct sockaddr_in6</var> always-<b class="Sy">0</b>
      <var class="Fa">sin6_flowinfo</var> field, residing at the same offset as
      the expected <var class="Fa">sin_addr</var> field (cf.
      <a class="Xr" href="https://manpages.debian.org/bullseye/ip.7">ip(7)</a>,
      <a class="Xr" href="https://manpages.debian.org/bullseye/ipv6.7">ipv6(7)</a>),</li>
  <li>glibc, on the other hand, uses
      <a class="Xr" href="https://manpages.debian.org/bullseye/gethostbyname_r.3">gethostbyname_r(3)</a>,
      querying only IPv4 addresses ex def., so if one wasn't found it returns a
      <b class="Sy">0</b> in the error path.</li>
</ul>
So, in their equally byzantine ways, here at least they are exactly identical.
</section>
<section class="Ss">
<h2 class="Ss" id="References"><a class="permalink" href="#References">References</a></h2>
<p class="Pp">&#x00B9;
    <a class="Lk" href="https://twitter.com/nabijaczleweli/status/1528864887954616321">https://twitter.com/nabijaczleweli/status/1528864887954616321</a>
  <br/>
  &#x00B2;
    <a class="Lk" href="https://twitter.com/gedamore/status/1524961429794631680">https://twitter.com/gedamore/status/1524961429794631680</a></p>
</section>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">June 13, 2021</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/id.1 => man1/id.1 +2 -2
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 30, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt ID 1
.Os voreutils pre-v0.0.0-latest


@@ 12,7 12,7 @@
.Nm
.Oo Ar user Oc Ns …
.Nm
.Fl u Ns | Ns Fl g Ns | Ns Fl G
.Fl u Ns \&| Ns Fl g Ns \&| Ns Fl G
.Op Fl nrz
.Oo Ar user Oc Ns …
.Nm

M man1/id.1.html => man1/id.1.html +2 -2
@@ 191,7 191,7 @@ In this mode, unknown groups are printed as numbers and a diagnostic is issued.
  not since it uses /etc/utmp.</div>
<p class="Pp"><code class="Nm">groups</code> first appeared in
    <span class="Ux">4.2BSD</span> as
    <a class="Xr" href="https://manpages.debian.org/bullseye/groups.1">groups(1)</a>:</p>
    <a class="Xr" href="../man1/groups.1.html">groups(1)</a>:</p>
<div class="Bd
  Bd-indent"><a class="permalink" href="#groups"><b class="Sy" id="groups">groups
  [user]</b></a></div>


@@ 219,7 219,7 @@ entry and <code class="Fl">-p</code> extension, deprecating
</div>
<table class="foot">
  <tr>
    <td class="foot-date">December 30, 2021</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/link.1 => man1/link.1 +5 -5
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd April  2, 2022
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt LINK 1
.Os voreutils pre-v0.0.0-latest


@@ 36,8 36,8 @@ failed.
.Sh STANDARDS
Conforms to
.St -p1003.1-2008 .
.
.Sh HISTORY
Created in
.St -susv2
as an
.St -xcu5
extension, with no further comments.
.St -susv2 ,
marked as an XSI extension.

M man1/link.1.html => man1/link.1.html +8 -6
@@ 57,16 57,18 @@
<section class="Sh">
<h1 class="Sh" id="STANDARDS"><a class="permalink" href="#STANDARDS">STANDARDS</a></h1>
<p class="Pp">Conforms to <span class="St">IEEE Std 1003.1-2008
    (&#x201C;POSIX.1&#x201D;)</span>. Created in
    <span class="St">Version&#x00A0;2 of the Single UNIX Specification
    (&#x201C;SUSv2&#x201D;)</span> as an <span class="St">X/Open Commands and
    Utilities Issue&#x00A0;5 (&#x201C;XCU5&#x201D;)</span> extension, with no
    further comments.</p>
    (&#x201C;POSIX.1&#x201D;)</span>.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">Created in <span class="St">Version&#x00A0;2 of the Single UNIX
    Specification (&#x201C;SUSv2&#x201D;)</span>, marked as an XSI
  extension.</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">April 2, 2022</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/logname.1 => man1/logname.1 +46 -16
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd August 29, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt LOGNAME 1
.Os voreutils pre-v0.0.0-latest


@@ 13,8 13,8 @@
.
.Sh DESCRIPTION
Prints the result of
.Xr getlogin 3
followed by a newline to the standard output stream, or, if it fails, a diagnostic to the standard error stream.
.Xr getlogin 3 ,
followed by a newline, to the standard output stream.
.
.Sh EXIT STATUS
.Sy 1


@@ 31,21 31,51 @@ failed.
Conforms to
.St -p1003.1-2008
\(em the non-normative section specifies that it should ignore the
.Ev NAME
and
.Ev LOGNAME
environment variables, as the environment may be neither trusted nor consistent, but no known implementation does this, and some
.Lb libc
implementations implement an out-of-spec \" musl
environment variable, as the environment may be neither trusted nor consistent, but
.Xr getlogin 3
which simply returns
.Ev LOGNAME .
is itself allowed to return
.Ev LOGNAME ,
and some implementations do.  \" musl
.
.Sh HISTORY
First appeared in
.At III ,
alongside libPW's
Appeared in
.No Programmer's Workbench Pq Tn PWB/UNIX ,
writing
.Fn logname
.Pq which read it from Tn PWB Ns -specific per-process inherited private user data ; Xr loginfo II .
.Pp
.At III
inherits it, but with
.Fn logname
returning
.Ev LOGNAME .
.Pp
.At V.1
.Nm
writes
.Xr cuserid 3
.Pq either Xr getlogin 3 , No or the username of the current UID ,
where
.Xr getlogin 3
reads the
.Xr utmp 5
entry corresponding to the teletype attached the standard input, output, or error stream.
.Pp
.Tn X/Open No Portability Guide Pq Dq Tn XPG  \" .St -xpg1
imports
.At V.1
.Xr getlogin 3C ,
explicitly requiring
.Xr utmp 5
parsing.
.Pp
.Tn X/Open No Portability Guide Issue\~2 Pq Dq Tn XPG Ns \^2  \" .St -xpg2
standardises
.Nm
verbatim as "the user's login name".
.Pp
.St -p1003.2-92
narrows it to
.Fn getlogin
.Pq which did just return Ev LOGNAME ,
standardised verbatim by
.St -p1003.2-92 .
only.

M man1/logname.1.html => man1/logname.1.html +39 -14
@@ 35,9 35,8 @@
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">Prints the result of
    <a class="Xr" href="https://manpages.debian.org/bullseye/getlogin.3">getlogin(3)</a>
    followed by a newline to the standard output stream, or, if it fails, a
    diagnostic to the standard error stream.</p>
    <a class="Xr" href="https://manpages.debian.org/bullseye/getlogin.3">getlogin(3)</a>,
    followed by a newline, to the standard output stream.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="EXIT_STATUS"><a class="permalink" href="#EXIT_STATUS">EXIT


@@ 56,25 55,51 @@
<h1 class="Sh" id="STANDARDS"><a class="permalink" href="#STANDARDS">STANDARDS</a></h1>
<p class="Pp">Conforms to <span class="St">IEEE Std 1003.1-2008
    (&#x201C;POSIX.1&#x201D;)</span> &#x2014; the non-normative section
    specifies that it should ignore the <code class="Ev">NAME</code> and
    <code class="Ev">LOGNAME</code> environment variables, as the environment
    may be neither trusted nor consistent, but no known implementation does
    this, and some <span class="Lb">Standard C&#x00A0;Library (libc, -lc)</span>
    implementations implement an out-of-spec
    specifies that it should ignore the <code class="Ev">LOGNAME</code>
    environment variable, as the environment may be neither trusted nor
    consistent, but
    <a class="Xr" href="https://manpages.debian.org/bullseye/getlogin.3">getlogin(3)</a>
    which simply returns <code class="Ev">LOGNAME</code>.</p>
    is itself allowed to return <code class="Ev">LOGNAME</code>, and some
    implementations do.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">First appeared in <span class="Ux">AT&amp;T System&#x00A0;III
    UNIX</span>, alongside libPW's <code class="Fn">getlogin</code>() (which did
    just return <code class="Ev">LOGNAME</code>), standardised verbatim by
    <span class="St">IEEE Std 1003.2-1992 (&#x201C;POSIX.2&#x201D;)</span>.</p>
<p class="Pp">Appeared in <span class="No">Programmer's Workbench</span>
    (PWB/UNIX), writing <code class="Fn">logname</code>() (which read it from
    PWB-specific per-process inherited private user data;
    <a class="Xr" href="https://manpages.debian.org/bullseye/loginfo.II">loginfo(II)</a>).</p>
<p class="Pp"><span class="Ux">AT&amp;T System&#x00A0;III UNIX</span> inherits
    it, but with <code class="Fn">logname</code>() returning
    <code class="Ev">LOGNAME</code>.</p>
<p class="Pp"><span class="Ux">AT&amp;T System&#x00A0;V Release&#x00A0;1
    UNIX</span> <code class="Nm">logname</code> writes
    <a class="Xr" href="https://manpages.debian.org/bullseye/cuserid.3">cuserid(3)</a>
    (either
    <a class="Xr" href="https://manpages.debian.org/bullseye/getlogin.3">getlogin(3)</a>,
    <span class="No">or the username of the current UID</span>), where
    <a class="Xr" href="https://manpages.debian.org/bullseye/getlogin.3">getlogin(3)</a>
    reads the
    <a class="Xr" href="https://manpages.debian.org/bullseye/utmp.5">utmp(5)</a>
    entry corresponding to the teletype attached the standard input, output, or
    error stream.</p>
<p class="Pp">X/Open <span class="No">Portability Guide</span>
    (&#x201C;XPG&#x201D;) imports <span class="Ux">AT&amp;T System&#x00A0;V
    Release&#x00A0;1 UNIX</span>
    <a class="Xr" href="https://manpages.debian.org/bullseye/getlogin.3C">getlogin(3C)</a>,
    explicitly requiring
    <a class="Xr" href="https://manpages.debian.org/bullseye/utmp.5">utmp(5)</a>
    parsing.</p>
<p class="Pp">X/Open <span class="No">Portability Guide Issue&#x00A0;2</span>
    (&#x201C;XPG2&#x201D;) standardises <code class="Nm">logname</code> verbatim
    as &quot;the user's login name&quot;.</p>
<p class="Pp"><span class="St">IEEE Std 1003.2-1992
    (&#x201C;POSIX.2&#x201D;)</span> narrows it to
    <code class="Fn">getlogin</code>() only.</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">August 29, 2021</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

A man1/machine.1 => man1/machine.1 +1 -0
@@ 0,0 1,1 @@
uname.1
\ No newline at end of file

A man1/machine.1.html => man1/machine.1.html +1 -0
@@ 0,0 1,1 @@
uname.1.html
\ No newline at end of file

M man1/mkfifo.1 => man1/mkfifo.1 +2 -2
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 30, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt MKFIFO 1
.Os voreutils pre-v0.0.0-latest


@@ 76,7 76,7 @@ conforms to
.Fl -context
is an extension, also present on the GNU system.
.Pp
.Nm mknod Cm c Ns | Ns Cm b
.Nm mknod Cm c Ns \&| Ns Cm b
is compatible with
.At v4 ;
.Nm mknod Cm p

M man1/mkfifo.1.html => man1/mkfifo.1.html +1 -1
@@ 140,7 140,7 @@ Alongside the corresponding
</div>
<table class="foot">
  <tr>
    <td class="foot-date">December 30, 2021</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/mktemp.1 => man1/mktemp.1 +3 -3
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 30, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt MKTEMP 1
.Os voreutils pre-v0.0.0-latest


@@ 15,7 15,7 @@
.Op Fl s Ar suffix
.Nm
.Op Fl dqu
.Op Fl t Ns | Ns Fl p Ar directory
.Op Fl t Ns \&| Ns Fl p Ar directory
.Op Fl s Ar suffix
.Ar template
.


@@ 189,7 189,7 @@ then remove it.
An
.Ox Ns -compatible
.Nm
also exists in Illumos.
also exists in the illumos gate.
.Pp
The only
.No strictly- Ns St -p1003.1-2008 Ns -compliant

M man1/mktemp.1.html => man1/mktemp.1.html +2 -2
@@ 170,7 170,7 @@ mktemp <var class="Ar">/var/tmp/cleanup-XXXXXXXX.log</var>)&quot; || exit</div>
    three of those implementations first create the file with
    <code class="Fl">-u</code>, then remove it. An
    <span class="Ux">OpenBSD</span>-compatible <code class="Nm">mktemp</code>
    also exists in Illumos.</p>
    also exists in the illumos gate.</p>
<p class="Pp">The only <span class="No">strictly-</span><span class="St">IEEE
    Std 1003.1-2008 (&#x201C;POSIX.1&#x201D;)</span>-compliant way to emulate
    <code class="Nm">mktemp</code> is to use</p>


@@ 201,7 201,7 @@ Supporting <code class="Fl">-dqu</code>, defaulting to a
</div>
<table class="foot">
  <tr>
    <td class="foot-date">December 30, 2021</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/nice.1 => man1/nice.1 +3 -2
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd January 23, 2022
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt NICE 1
.Os voreutils pre-v0.0.0-latest


@@ 87,7 87,8 @@ on all known systems.
A way to alter scheduling priority first appeared in
.At v2
as
.Xr hog II :
.Xr hog II ,
"set low-priority status" in the index and:
.Dl "NAME            hog -\&- set program in low priority"
Moving the caller to the low-priority queue, which "background jobs that execute for a long time should do".
The job was moved back to the regular queue "as soon as the process is dismissed for any reason other than quantum overflow" (when a syscall is made).

M man1/nice.1.html => man1/nice.1.html +3 -2
@@ 102,7 102,8 @@
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">A way to alter scheduling priority first appeared in
    <span class="Ux">Version&#x00A0;2 AT&amp;T UNIX</span> as
    <a class="Xr" href="https://manpages.debian.org/bullseye/hog.II">hog(II)</a>:</p>
    <a class="Xr" href="https://manpages.debian.org/bullseye/hog.II">hog(II)</a>,
    &quot;set low-priority status&quot; in the index and:</p>
<div class="Bd Bd-indent"><code class="Li">NAME hog -- set program in low
  priority</code></div>
Moving the caller to the low-priority queue, which &quot;background jobs that


@@ 153,7 154,7 @@ Moving the caller to the low-priority queue, which &quot;background jobs that
</div>
<table class="foot">
  <tr>
    <td class="foot-date">January 23, 2022</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/nohup.1 => man1/nohup.1 +98 -9
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd January 23, 2022
.Dd May 13, 2022
.ds doc-volume-operating-system
.Dt NOHUP 1
.Os voreutils pre-v0.0.0-latest


@@ 24,28 24,27 @@ It does so by:
.Bl -enum -compact -offset 4n -width "a"
.It
ignoring
.Sy SIGHUP
.Dv SIGHUP
.Pq see Xr signal 7 for its circumstances and consequences ,
.
.It
if the standard input stream is a teletype, binding it to a write-only
.Pa /dev/null
stream, such that reads therefrom will hence fail with
.Sy EINVAL ,
.Er EBADF ,
.
.It
if the standard output stream is a teletype, appending it to
.Pa nohup.out ,
or, should that fail,
.Pa $HOME/nohup.out
.Ev $HOME Ns Pa /nohup.out
.Pq provided the Ev HOME No environment variable is set ,
creating the file as
.Li u=rw
\-
.Va umask
if necessary,
.
.It
.\" Yes, we're not specifying the additional isatty(stderr) && stdout closed => like stdout but for stderr step here. I don't think it matters.
if the standard error stream is a teletype, binding it to the standard output stream, and finally
.
.It


@@ 64,7 63,7 @@ or both
.Pa nohup.out Ns s
when required is a fatal error.
.Pp
If the standard output or error stream are terminals, a summary of redirexions and the location of the file are written to the standard error stream before being redirected.
If any standard I/O stream is a teletype, a summary of redirexions and the location of the file are written to the standard error stream before being redirected.
.
.Sh ENVIRONMENT
.Bl -tag -compact -width ".Ev HOME"


@@ 98,8 97,98 @@ returned by
.
.Sh STANDARDS
Conforms to
.St -p1003.1-2008 .
.St -p1003.1-2008 ;
redirecting the standard input stream is an optional feature, and isn't widely implemented outside of the GNU system \(em prefer
.Li < Pa /dev/null
for portability.
.Pp
Noting the output redirexions if the standard error stream is a teletype is an extension, also present on the GNU system, which also exits
Noting stream redirexions if the standard output stream is not a teletype is an extension, also present on the GNU system, which also exits
.Sy 125
for set-up errors.
.
.Sh HISTORY
.\" Do NOT add formatting here: these are carefully copied from the V4 manual
Appeared in
.At v4
as
.D1 nohup \- run a command immune to hangups
executing
.Ar program
.Qq with hangups, quits and interrupts all ignored .
.Pp
.At v7
sees a merged manual page with
.Xr nice 1 ,
and a shell implementation ignoring
.Dv SIGHUP
and
.Dv SIGTERM ,
increasing niceness by
.Sy 5 ,
and redirecting all output to
.Pa nohup.out
if the standard error stream is a teletype:
.\" v7: Caldera, 4-clause BSD
.Bd -literal -compact -offset Ds
.Ic trap Li \&"" Sy 1 15
.Ic if Nm test Fl t Li "2>&1  ;"\& Ic then
.Nm "       " echo Li \&"Sending output to 'nohup.out'"
.Ic "       " exec Nm nice Fl 5 Ar $* Li >> Ns Pa nohup.out Li 2>&1
.Ic else
.Ic "       " exec Nm nice Fl 5 Ar $* Li 2>&1
.Ic fi
.Ed
.Pp
.Bx 4.3 Reno
quotes
.St -p1003.2
compatibility, but "appends" to
.Pa nohup.out
with a single
.Fo lseek
.Fa SEEK_END
.Fc ,
exits
.Sy 1
on all errors, and also ignores
.Dv SIGQUIT .
.Pp
.At III
ignores
.Dv SIGHUP
and
.Dv SIGQUIT ,
exits
.Sy 2
on a setup error,
and handles standard output and error streams as present-day,
If executing
.Ar program
fails, the error is written to
.Pa /dev/tty .
.Pp
.At V.1
exits
.Sy 1
on setup errors and writes the actual
.Xr execvp 3
error rather than always "not found".
.
.Ss Standards
.Tn X/Open No Portability Guide Issue\~2 Pq Dq Tn XPG Ns \^2  \" .St -xpg2
specifies
.At III
verbatim.
.Pp
.St -xpg4 \" (see XPG3-XPG4 migration guide)
specifies only
.Dv SIGHUP ,
noting that extant implementations variably also ignore either
.Dv SIGQUIT
or
.Dv SIGTERM .
.Pp
.St -p1003.1-2008
allows for the standard input stream to be redirected from an "unspecified file" if it's a teletype,
following the GNU system.
.\" Interpretation #104

M man1/nohup.1.html => man1/nohup.1.html +73 -17
@@ 41,20 41,18 @@
    system.</p>
<p class="Pp">It does so by:</p>
<ol class="Bl-enum Bd-indent Bl-compact">
  <li id="SIGHUP">ignoring
      <a class="permalink" href="#SIGHUP"><b class="Sy">SIGHUP</b></a> (see
  <li>ignoring <code class="Dv">SIGHUP</code> (see
      <a class="Xr" href="https://manpages.debian.org/bullseye/signal.7">signal(7)</a>
      for its circumstances and consequences),</li>
  <li id="EINVAL">if the standard input stream is a teletype, binding it to a
      write-only <span class="Pa">/dev/null</span> stream, such that reads
      therefrom will hence fail with
      <a class="permalink" href="#EINVAL"><b class="Sy">EINVAL</b></a>,</li>
  <li>if the standard input stream is a teletype, binding it to a write-only
      <span class="Pa">/dev/null</span> stream, such that reads therefrom will
      hence fail with <code class="Er">EBADF</code>,</li>
  <li>if the standard output stream is a teletype, appending it to
      <span class="Pa">nohup.out</span>, or, should that fail,
      <span class="Pa">$HOME/nohup.out</span> (provided the
      <code class="Ev">HOME</code> <span class="No">environment variable is
      set</span>), creating the file as <code class="Li">u=rw</code> -
      <var class="Va">umask</var> if necessary,</li>
      <code class="Ev">$HOME</code><span class="Pa">/nohup.out</span> (provided
      the <code class="Ev">HOME</code> <span class="No">environment variable is
      set</span>), creating the file as <code class="Li">u=rw</code> if
      necessary,</li>
  <li>if the standard error stream is a teletype, binding it to the standard
      output stream, and finally</li>
  <li>executing <var class="Ar">program argument</var>s, searching for


@@ 63,9 61,9 @@
<p class="Pp">If any standard I/O stream was unopened, it will remain unopened.
    Failure to open <span class="Pa">/dev/null</span> or both
    <span class="Pa">nohup.out</span>s when required is a fatal error.</p>
<p class="Pp">If the standard output or error stream are terminals, a summary of
    redirexions and the location of the file are written to the standard error
    stream before being redirected.</p>
<p class="Pp">If any standard I/O stream is a teletype, a summary of redirexions
    and the location of the file are written to the standard error stream before
    being redirected.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="ENVIRONMENT"><a class="permalink" href="#ENVIRONMENT">ENVIRONMENT</a></h1>


@@ 101,16 99,74 @@
<section class="Sh">
<h1 class="Sh" id="STANDARDS"><a class="permalink" href="#STANDARDS">STANDARDS</a></h1>
<p class="Pp">Conforms to <span class="St">IEEE Std 1003.1-2008
    (&#x201C;POSIX.1&#x201D;)</span>.</p>
<p class="Pp" id="125">Noting the output redirexions if the standard error
    stream is a teletype is an extension, also present on the GNU system, which
    (&#x201C;POSIX.1&#x201D;)</span>; redirecting the standard input stream is
    an optional feature, and isn't widely implemented outside of the GNU system
    &#x2014; prefer <code class="Li">&lt;</code>
    <span class="Pa">/dev/null</span> for portability.</p>
<p class="Pp" id="125">Noting stream redirexions if the standard output stream
    is not a teletype is an extension, also present on the GNU system, which
    also exits <a class="permalink" href="#125"><b class="Sy">125</b></a> for
    set-up errors.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">Appeared in <span class="Ux">Version&#x00A0;4 AT&amp;T UNIX</span>
    as</p>
<div class="Bd Bd-indent">nohup - run a command immune to hangups</div>
executing <var class="Ar">program</var> &quot;with hangups, quits and interrupts
  all ignored&quot;.
<p class="Pp" id="5"><span class="Ux">Version&#x00A0;7 AT&amp;T UNIX</span> sees
    a merged manual page with
    <a class="Xr" href="../man1/nice.1.html">nice(1)</a>, and a shell
    implementation ignoring <code class="Dv">SIGHUP</code> and
    <code class="Dv">SIGTERM</code>, increasing niceness by
    <a class="permalink" href="#5"><b class="Sy">5</b></a>, and redirecting all
    output to <span class="Pa">nohup.out</span> if the standard error stream is
    a teletype:</p>
<div class="Bd Bd-indent Li">
<pre><code class="Ic">trap</code> <code class="Li">&quot;&quot;</code> <b class="Sy">1 15</b>
<code class="Ic">if</code> <code class="Nm">test</code> <code class="Fl">-t</code> <code class="Li">2&gt;&amp;1  ; </code> <code class="Ic">then</code>
<code class="Nm">        echo</code> <code class="Li">&quot;Sending output to 'nohup.out'&quot;</code>
<code class="Ic">        exec</code> <code class="Nm">nice</code> <code class="Fl">-5</code> <var class="Ar">$*</var> <code class="Li">&gt;&gt;</code><span class="Pa">nohup.out</span> <code class="Li">2&gt;&amp;1</code>
<code class="Ic">else</code>
<code class="Ic">        exec</code> <code class="Nm">nice</code> <code class="Fl">-5</code> <var class="Ar">$*</var> <code class="Li">2&gt;&amp;1</code>
<code class="Ic">fi</code></pre>
</div>
<p class="Pp"><span class="Ux">4.3BSD-Reno</span> quotes <span class="St">IEEE
    Std 1003.2 (&#x201C;POSIX.2&#x201D;)</span> compatibility, but
    &quot;appends&quot; to <span class="Pa">nohup.out</span> with a single
    <code class="Fn">lseek</code>(<var class="Fa">SEEK_END</var>);, exits
    <b class="Sy">1</b> on all errors, and also ignores
    <code class="Dv">SIGQUIT</code>.</p>
<p class="Pp" id="2"><span class="Ux">AT&amp;T System&#x00A0;III UNIX</span>
    ignores <code class="Dv">SIGHUP</code> and <code class="Dv">SIGQUIT</code>,
    exits <a class="permalink" href="#2"><b class="Sy">2</b></a> on a setup
    error, and handles standard output and error streams as present-day, If
    executing <var class="Ar">program</var> fails, the error is written to
    <span class="Pa">/dev/tty</span>.</p>
<p class="Pp"><span class="Ux">AT&amp;T System&#x00A0;V Release&#x00A0;1
    UNIX</span> exits <b class="Sy">1</b> on setup errors and writes the actual
    <a class="Xr" href="https://manpages.debian.org/bullseye/execvp.3">execvp(3)</a>
    error rather than always &quot;not found&quot;.</p>
<section class="Ss">
<h2 class="Ss" id="Standards"><a class="permalink" href="#Standards">Standards</a></h2>
<p class="Pp">X/Open <span class="No">Portability Guide Issue&#x00A0;2</span>
    (&#x201C;XPG2&#x201D;) specifies <span class="Ux">AT&amp;T System&#x00A0;III
    UNIX</span> verbatim.</p>
<p class="Pp"><span class="St">X/Open Portability Guide Issue&#x00A0;4
    (&#x201C;XPG4&#x201D;)</span> specifies only <code class="Dv">SIGHUP</code>,
    noting that extant implementations variably also ignore either
    <code class="Dv">SIGQUIT</code> or <code class="Dv">SIGTERM</code>.</p>
<p class="Pp"><span class="St">IEEE Std 1003.1-2008
    (&#x201C;POSIX.1&#x201D;)</span> allows for the standard input stream to be
    redirected from an &quot;unspecified file&quot; if it's a teletype,
    following the GNU system.</p>
</section>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">January 23, 2022</td>
    <td class="foot-date">May 13, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/paste.1 => man1/paste.1 +5 -4
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 30, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt PASTE 1
.Os voreutils pre-v0.0.0-latest


@@ 99,10 99,11 @@ are extensions, also present on the GNU system.
.Sh HISTORY
.\" This is actually copied from CB-UNIX 2.1, but they're the same file
Appeared, fully formed, as
.Xr paste 1 :
.D1 paste \- merge same lines of several files or subsequent lines of a file
in several
.At Ns es
that became part of
in
.Tn CB-UNIX ,
later part of
.At III ,
.\" https://inbox.vuxu.org/tuhs/202001150454.00F4sF9H013965@cuzuco.com/T/#r2bd4ae0313fd0aeb22ea2b21748bce2dfe833c25
written by Gottfried W. R. Luderer,

M man1/paste.1.html => man1/paste.1.html +6 -5
@@ 124,12 124,13 @@ paste <code class="Fl">-sd</code> <var class="Ar">'\t\n'</var>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">Appeared, fully formed, as</p>
<p class="Pp">Appeared, fully formed, as
    <a class="Xr" href="../man1/paste.1.html">paste(1)</a>:</p>
<div class="Bd Bd-indent">paste - merge same lines of several files or
  subsequent lines of a file</div>
in several <span class="Ux">AT&amp;T UNIX</span>es that became part of
  <span class="Ux">AT&amp;T System&#x00A0;III UNIX</span>, written by Gottfried
  W. R. Luderer, in-or-before November of 1978. The implementation notes:
in CB-UNIX, later part of <span class="Ux">AT&amp;T System&#x00A0;III
  UNIX</span>, written by Gottfried W. R. Luderer, in-or-before November of
  1978. The implementation notes:
<div class="Bd Bd-indent Li">
<pre>/* paste: concatenate corresponding lines of each file in parallel(GWRL) */
/*      (-s option: serial concatenation like old (127's) paste command */</pre>


@@ 143,7 144,7 @@ but no evidence of a <code class="Nm">paste</code> from 127 (AT&amp;T's Computer
</div>
<table class="foot">
  <tr>
    <td class="foot-date">December 30, 2021</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/pathchk.1 => man1/pathchk.1 +3 -3
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd January  6, 2022
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt PATHCHK 1
.Os voreutils pre-v0.0.0-latest


@@ 144,7 144,7 @@ with only
to, alongside
.Xr sh 1
noclobber
.Pq Nm set Fl C ,
.Pq Ic set Fl C ,
replace the need for the proposed
.Xr mktemp 1 ,
.Nm validfnam ,


@@ 166,5 166,5 @@ needs to be used to ensure "full filename portability" across all systems, with 
.Dv PATH_MAX ,
well, isn't \(em it's defined to
.Sy 4096
on all modern systems for compatibility, but longer paths are, usually, perfectly legal.
on all modern systems for compatibility, but longer paths are, usually, perfectly legal, just not necessarily usable as a syscall argument.
Keep this in mind.

M man1/pathchk.1.html => man1/pathchk.1.html +4 -3
@@ 124,7 124,7 @@ pathchk: ./fips180-2withchangenotice.pdf: fips180-2withchangenotice.pdf: too lon
    (&#x201C;POSIX.2&#x201D;)</span> with only <code class="Fl">-p</code>, to,
    alongside
    <a class="Xr" href="https://manpages.debian.org/bullseye/sh.1">sh(1)</a>
    noclobber (<code class="Nm">set</code> <code class="Fl">-C</code>), replace
    noclobber (<code class="Ic">set</code> <code class="Fl">-C</code>), replace
    the need for the proposed
    <a class="Xr" href="../man1/mktemp.1.html">mktemp(1)</a>,
    <code class="Nm">validfnam</code>, and similar utilities, quoting pairing


@@ 141,12 141,13 @@ pathchk: ./fips180-2withchangenotice.pdf: fips180-2withchangenotice.pdf: too lon
<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1>
<p class="Pp"><code class="Dv">PATH_MAX</code>, well, isn't &#x2014; it's
    defined to <b class="Sy">4096</b> on all modern systems for compatibility,
    but longer paths are, usually, perfectly legal. Keep this in mind.</p>
    but longer paths are, usually, perfectly legal, just not necessarily usable
    as a syscall argument. Keep this in mind.</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">January 6, 2022</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/printenv.1 => man1/printenv.1 +32 -5
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd January 20, 2022
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt PRINTENV 1
.Os voreutils pre-v0.0.0-latest


@@ 20,7 20,7 @@ and order, separated by newlines.
.Pp
If
.Ar variable Ns s
are specified, print their values, in the order specified, separated by newlines, instead.
are specified, prints their values, in the order specified, separated by newlines.
.
.Sh OPTIONS
.Bl -tag -compact -width ".Fl 0 , -null"


@@ 40,11 40,38 @@ specified didn't exist.
.
.Sh HISTORY
.\" Do NOT add formatting here: this is copied from the raw 2BSD manpage
Appeared fully formed in
Appeared, fully formed, in
.Bx 2
as
.Xr printenv UCB :
.Dl Sy printenv No "[ name ]"
.D1 printenv \- print out the environment
with a
.Sx SYNOPSIS
of
.D1 "\fBprintenv\fP [ name ]"
but only checking that the names
.Em start
with
.Ar name
\(em
.Nm Ar A
would write the values of both
.Ev A
and
.Ev AA .
.Pp
.Bx 3
fixes this.
.Pp
.At V.4
includes
.Bx 3
.Nm
in
.Pa /usr/ucb .
.Pp
Multiple
.Ar variable Ns s
and
.Fl 0
is an extension, originating from the GNU system.
are extensions, originating from the GNU system.

M man1/printenv.1.html => man1/printenv.1.html +19 -9
@@ 38,8 38,8 @@
<p class="Pp">Prints all variables in the environment in their original format
    (<code class="Ev">KEY</code><a class="permalink" href="#="><b class="Sy" id="=">=</b></a><code class="Ev">VALUE</code>)
    and order, separated by newlines.</p>
<p class="Pp">If <var class="Ar">variable</var>s are specified, print their
    values, in the order specified, separated by newlines, instead.</p>
<p class="Pp">If <var class="Ar">variable</var>s are specified, prints their
    values, in the order specified, separated by newlines.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="OPTIONS"><a class="permalink" href="#OPTIONS">OPTIONS</a></h1>


@@ 63,18 63,28 @@
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">Appeared fully formed in <span class="Ux">2BSD</span> as
<p class="Pp">Appeared, fully formed, in <span class="Ux">2BSD</span> as
    <a class="Xr" href="https://manpages.debian.org/bullseye/printenv.UCB">printenv(UCB)</a>:</p>
<div class="Bd
  Bd-indent"><code class="Li"><a class="permalink" href="#printenv"><b class="Sy" id="printenv">printenv</b></a>
  <span class="No">[ name ]</span></code></div>
<p class="Pp"><code class="Fl">-0</code> is an extension, originating from the
    GNU system.</p>
<div class="Bd Bd-indent">printenv - print out the environment</div>
with a <a class="Sx" href="#SYNOPSIS">SYNOPSIS</a> of
<div class="Bd Bd-indent"><b>printenv</b> [ name ]</div>
but only checking that the names
  <a class="permalink" href="#start"><i class="Em" id="start">start</i></a> with
  <var class="Ar">name</var> &#x2014; <code class="Nm">printenv</code>
  <var class="Ar">A</var> would write the values of both
  <code class="Ev">A</code> and <code class="Ev">AA</code>.
<p class="Pp"><span class="Ux">3BSD</span> fixes this.</p>
<p class="Pp"><span class="Ux">AT&amp;T System&#x00A0;V Release&#x00A0;4
    UNIX</span> includes <span class="Ux">3BSD</span>
    <code class="Nm">printenv</code> in <span class="Pa">/usr/ucb</span>.</p>
<p class="Pp">Multiple <var class="Ar">variable</var>s and
    <code class="Fl">-0</code> are extensions, originating from the GNU
  system.</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">January 20, 2022</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/printf.1 => man1/printf.1 +14 -15
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 30, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt PRINTF 1
.Os voreutils pre-v0.0.0-latest


@@ 272,8 272,9 @@ and
.Cm %b .
.Pp
.Cm %CS
are extensions, provided for exhaustion with
.St -p1003.1-2008 w/XSI's
are extensions, provided for exhaustion of
.St -p1003.1-2008
against X/Open Systems Interfaces (XSI)
.Xr printf 3 ;
they're equivalent to
.Cm %lc


@@ 299,17 300,15 @@ escapes and conversions; be wary.
.Sh HISTORY
Created by
.St -xpg4 \" (see XPG3-XPG4 migration guide)
as
.At V
to provide a portable way to mimic
.At V.3
.Nm echo
processed escape sequences in the same format as
.Nm Ns 's
.Cm %b
.Pq rather, Nm Ns 's Cm %b No mirrors XSI Nm echo
but
.Bx
.Nm echo
only understood
.Fl n
as the first argument, cf.
with
.Cm %b ,
in contrast to the incompatible
.At v7
.Nm echo ,
only supporting first-argument
.Fl n ,
cf.\&
.Xr echo 1 .

M man1/printf.1.html => man1/printf.1.html +9 -11
@@ 253,8 253,8 @@ $ \U0001F629081
    (<code class="Cm">%aAeEfFgG</code>) conversions as optional, and requires
    only <code class="Cm">%diouxXcs</code> and <code class="Cm">%b</code>.</p>
<p class="Pp"><code class="Cm">%CS</code> are extensions, provided for
    exhaustion with <span class="St">IEEE Std 1003.1-2008
    (&#x201C;POSIX.1&#x201D;)</span> w/XSI's
    exhaustion of <span class="St">IEEE Std 1003.1-2008
    (&#x201C;POSIX.1&#x201D;)</span> against X/Open Systems Interfaces (XSI)
    <a class="Xr" href="https://manpages.debian.org/bullseye/printf.3">printf(3)</a>;
    they're equivalent to <code class="Cm">%lc</code> and
    <code class="Cm">%ls</code>, and hence equivalent to


@@ 270,20 270,18 @@ $ \U0001F629081
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">Created by <span class="St">X/Open Portability Guide
    Issue&#x00A0;4 (&#x201C;XPG4&#x201D;)</span> as <span class="Ux">AT&amp;T
    System&#x00A0;V UNIX</span> <code class="Nm">echo</code> processed escape
    sequences in the same format as <code class="Nm">printf</code>'s
    <code class="Cm">%b</code> (rather, <code class="Nm">printf</code>'s
    <code class="Cm">%b</code> <span class="No">mirrors XSI</span>
    <code class="Nm">echo</code>) but <span class="Ux">BSD</span>
    <code class="Nm">echo</code> only understood <code class="Fl">-n</code> as
    the first argument, cf.
    Issue&#x00A0;4 (&#x201C;XPG4&#x201D;)</span> to provide a portable way to
    mimic <span class="Ux">AT&amp;T System&#x00A0;V Release&#x00A0;3 UNIX</span>
    <code class="Nm">echo</code> with <code class="Cm">%b</code>, in contrast to
    the incompatible <span class="Ux">Version&#x00A0;7 AT&amp;T UNIX</span>
    <code class="Nm">echo</code>, only supporting first-argument
    <code class="Fl">-n</code>, cf.
    <a class="Xr" href="../man1/echo.1.html">echo(1)</a>.</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">December 30, 2021</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/pwd.1 => man1/pwd.1 +17 -18
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 30, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt PWD 1
.Os voreutils pre-v0.0.0-latest


@@ 53,18 53,19 @@ if the working directory no longer exists.
.Ed
.Pp
.Bd -literal -compact
.Li $ Nm env Ev PWD Ns = Ns Pa /home/cicada//gachi/gachi/ Nm
.Li $ Ev PWD Ns Li = Ns Pa /home/cicada//gachi/gachi/ Nm
/home/cicada//gachi/gachi/
.Li $ Nm Fl P
/usr/home/cicada/gachi
.Li $ Nm env Ev PWD Ns = Ns Pa /home/cicada/./gachi/gachi/ Nm
.Li $ Ev PWD Ns Li = Ns Pa /home/cicada/./gachi/gachi/ Nm
/usr/home/cicada/gachi
.Li $ Nm env Ev PWD Ns = Ns Pa /ENOENT Nm
.Li $ Ev PWD Ns Li = Ns Pa /ENOENT Nm
/usr/home/cicada/gachi
.Ed
.
.Sh SEE ALSO
.Xr getcwd 3
.Xr getcwd 3 ,
.Xr environ 8
.
.Sh STANDARDS
Conforms to


@@ 72,21 73,19 @@ Conforms to
.
.Sh HISTORY
.\" Copied from v5 PDF
First appeared in
Appears in
.At v5 ,
with no flags, as
with no arguments, as
.Xr pwd I :
.D1 pwd \- print working directory pathname
.Pp
.St -p1003.2-92
standardises this format, but drafts thereof note some variation of
.Fl P Pq as noted in the Bx 4.4 Lite2 implementation, where it's explicitly ignored
and/or
.Fl L .
.\" TODO: figure this out
.Tn X/Open No Portability Guide Issue\~2 Pq Dq Tn XPG Ns \^2  \" .St -xpg2
standardises it verbatim.
.Pp
.St -p1003.1-2001
defines
.Fl LP
in their current form
.Pq though far too late for historical At V and Bx 4 systems .
.St -susv3
adds
.Fl LP ,
as present-day,
quoting a
.St -p1003.2
.Em draft .

M man1/pwd.1.html => man1/pwd.1.html +17 -19
@@ 75,24 75,25 @@ pwd
/usr/home/cicada</div>
<p class="Pp"></p>
<div class="Bd Li">
<pre><code class="Li">$</code> <code class="Nm">env</code> <code class="Ev">PWD</code>=<span class="Pa">/home/cicada//gachi/gachi/</span> <code class="Nm"></code></pre>
<pre><code class="Li">$</code> <code class="Ev">PWD</code><code class="Li">=</code><span class="Pa">/home/cicada//gachi/gachi/</span> <code class="Nm"></code></pre>
pwd
/home/cicada//gachi/gachi/
<code class="Li">$</code> <code class="Nm"></code>pwd <code class="Fl">-P</code>
/usr/home/cicada/gachi
<code class="Li">$</code> <code class="Nm">env</code>
  <code class="Ev">PWD</code>=<span class="Pa">/home/cicada/./gachi/gachi/</span>
<code class="Li">$</code>
  <code class="Ev">PWD</code><code class="Li">=</code><span class="Pa">/home/cicada/./gachi/gachi/</span>
  <code class="Nm"></code>pwd
/usr/home/cicada/gachi
<code class="Li">$</code> <code class="Nm">env</code>
  <code class="Ev">PWD</code>=<span class="Pa">/ENOENT</span>
<code class="Li">$</code>
  <code class="Ev">PWD</code><code class="Li">=</code><span class="Pa">/ENOENT</span>
  <code class="Nm"></code>pwd
/usr/home/cicada/gachi</div>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
  ALSO</a></h1>
<p class="Pp"><a class="Xr" href="https://manpages.debian.org/bullseye/getcwd.3">getcwd(3)</a></p>
<p class="Pp"><a class="Xr" href="https://manpages.debian.org/bullseye/getcwd.3">getcwd(3)</a>,
    <a class="Xr" href="https://manpages.debian.org/bullseye/environ.8">environ(8)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="STANDARDS"><a class="permalink" href="#STANDARDS">STANDARDS</a></h1>


@@ 101,25 102,22 @@ pwd
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">First appeared in <span class="Ux">Version&#x00A0;5 AT&amp;T
    UNIX</span>, with no flags, as
<p class="Pp">Appears in <span class="Ux">Version&#x00A0;5 AT&amp;T UNIX</span>,
    with no arguments, as
    <a class="Xr" href="https://manpages.debian.org/bullseye/pwd.I">pwd(I)</a>:</p>
<div class="Bd Bd-indent">pwd - print working directory pathname</div>
<p class="Pp"><span class="St">IEEE Std 1003.2-1992
    (&#x201C;POSIX.2&#x201D;)</span> standardises this format, but drafts
    thereof note some variation of <code class="Fl">-P</code> (as noted in the
    <span class="Ux">4.4BSD-Lite2</span> implementation, where it's explicitly
    ignored) and/or <code class="Fl">-L</code>.</p>
<p class="Pp"><span class="St">IEEE Std 1003.1-2001
    (&#x201C;POSIX.1&#x201D;)</span> defines <code class="Fl">-LP</code> in
    their current form (though far too late for historical
    <span class="Ux">AT&amp;T System&#x00A0;V UNIX</span> and
    <span class="Ux">4BSD-Systems</span>).</p>
<p class="Pp">X/Open <span class="No">Portability Guide Issue&#x00A0;2</span>
    (&#x201C;XPG2&#x201D;) standardises it verbatim.</p>
<p class="Pp" id="draft"><span class="St">Version&#x00A0;3 of the Single UNIX
    Specification (&#x201C;SUSv3&#x201D;)</span> adds
    <code class="Fl">-LP</code>, as present-day, quoting a <span class="St">IEEE
    Std 1003.2 (&#x201C;POSIX.2&#x201D;)</span>
    <a class="permalink" href="#draft"><i class="Em">draft</i></a>.</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">December 30, 2021</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/rm.1 => man1/rm.1 +2 -2
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 30, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt RM 1
.Os voreutils pre-v0.0.0-latest


@@ 190,7 190,7 @@ and
are extensions.
.
.Sh HISTORY
.Ss Research \s-2UNIX\s0
.Ss Research \s[-1z]UNIX\s0
.\" Copied from Unix Programmer's Manual, V3, V7, 4.1BSD manuals, XPG3
Appears in the first edition of the UNIX Programmer's Manual as
.Xr rm I :

M man1/rm.1.html => man1/rm.1.html +1 -1
@@ 334,7 334,7 @@ freeing the flags from the confines of the first argument and
</div>
<table class="foot">
  <tr>
    <td class="foot-date">December 30, 2021</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/sha1sum.1 => man1/sha1sum.1 +26 -23
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 30, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt SHA1SUM 1
.Os voreutils pre-v0.0.0-latest


@@ 109,16 109,19 @@ verify hashes from
.Ar file Ns s Pq likewise ,
against on-disk state.
.Pp
.\" mandoc compat; https://inbox.vuxu.org/mandoc-discuss/20220529001500.gnxuiiawdegcjwy7@tarta.nabijaczleweli.xyz/T/
.if !ddoc-Em-font .ds doc-Em-font \fI
.if !ddoc-Nm-font .ds doc-Nm-font \fB
.TS
lb lb lb lb
l  l  l  l  l .
Program	Digest	Standard	Length
_
\fBsha1sum\fP	SHA-1	FIPS PUB 180	160 bits	avoid use in security applications
\fBsha224sum\fP, \fBsha256sum\fP,
\fBsha384sum\fP, \fBsha512sum\fP	SHA-2	FIPS PUB 180-2	respective
\fBb2sum\fP	BLAKE2b	RFC 7693	8-512 bits
\fBmd5sum\fP	MD5	RFC 1321	128 bits	\fINOT\fP suitable for any application
\*[doc-Nm-font]sha1sum\fP	SHA-1	FIPS PUB 180	160 bits	avoid use in security applications
\*[doc-Nm-font]sha224sum\fP, \*[doc-Nm-font]sha256sum\fP,
\*[doc-Nm-font]sha384sum\fP, \*[doc-Nm-font]sha512sum\fP	SHA-2	FIPS PUB 180-2	respective
\*[doc-Nm-font]b2sum\fP	BLAKE2b	RFC 7693	8-512 bits
\*[doc-Nm-font]md5sum\fP	MD5	RFC 1321	128 bits	\*[doc-Em-font]NOT\fP suitable for any application
.TE
.
.Ss Generation


@@ 129,28 132,28 @@ nor
a listing is produced in the following form:
.Bd -literal -compact -offset Ds
.Li $ Nm sha1sum Li README.md
.Li 22eb73bd30d47540a4e05781f0f6e07640857cae Cm "\ " Ns Ar LICENCE
.Li 22eb73bd30d47540a4e05781f0f6e07640857cae Cm "\ " Ns Ar README.md
.Ed
With
.Fl b ,
an asterisk replaces the second space:
.Bd -literal -compact -offset Ds
.Li $ Nm echo Qo POSIX.2 Qc | Nm sha1sum Fl b
.Li 33210013f52127d6ada425601f16bbb62e85f3be Cm "*" Ns Ar -
.Li $ Nm echo Qo POSIX.2 Qc \&| Nm sha1sum Fl b
.Li 33210013f52127d6ada425601f16bbb62e85f3be Cm "*" Ns Pa -
.Ed
.Pp
With
.Fl -tag ,
the output is in the form
.Bd -literal -compact -offset Ds
.Li $ Nm echo Qo POSIX.2 Qc | Nm sha1sum Fl -tag Li LICENCE -
.Li $ Nm echo Qo POSIX.2 Qc \&| Nm sha1sum Fl -tag Li LICENCE -
.Cm SHA1 Ns Li \&( Ns Ar LICENCE Ns Li )\& Cm = Li bd25664d6e803060dcb31bfdd9642ba9d8a3f1b9
.Cm SHA1 Ns Li \&( Ns Ar - Ns Li )\& Cm = Li 33210013f52127d6ada425601f16bbb62e85f3be
.Cm SHA1 Ns Li \&( Ns Pa - Ns Li )\& Cm = Li 33210013f52127d6ada425601f16bbb62e85f3be
.Ed
A dash and width in bits is appended for non-default digest lengths:
.Bd -literal -compact -offset Ds
.Li $ Nm echo Qo POSIX.2 Qc | Nm b2sum Fl -tag l Ar 96
.Cm BLAKE2b- Ns Ar 96 Ns Li \&( Ns Ar - Ns Li )\& Cm = Li 386b90bea2a1e566249cdb96
.Li $ Nm echo Qo POSIX.2 Qc \&| Nm b2sum Fl -tag l Ar 96
.Cm BLAKE2b- Ns Ar 96 Ns Li \&( Ns Pa - Ns Li )\& Cm = Li 386b90bea2a1e566249cdb96
.Ed
.Pp
If the filename contains a backslash or newline characters, they're replaced with


@@ 225,12 228,12 @@ all output, except for diagnostics, is suppressed.
.Pp
Consider the following shell transcript:
.Bd -literal -compact -offset Ds
.Li $ Nm echo Qo POSIX.2 Qc | Nm sha1sum Li LICENCE - \&"$(printf 'UNIX\enregistered')" | Nm tee Ar sum
.Li 22eb73bd30d47540a4e05781f0f6e07640857cae Cm " " Ns Ar LICENCE
.Li 33210013f52127d6ada425601f16bbb62e85f3be Cm " " Ns Ar -
.Li $ Nm echo Qo POSIX.2 Qc \&| Nm sha1sum Li LICENCE - \&"$(printf 'UNIX\enregistered')" \&| Nm tee Ar sum
.Li 22eb73bd30d47540a4e05781f0f6e07640857cae Cm " " Ns Pa LICENCE
.Li 33210013f52127d6ada425601f16bbb62e85f3be Cm " " Ns Pa -
.Cm \e Ns Li 7390a4a0bfb7c6da55d6f5f3db4e42c534271363 Cm " " Ns Ar UNIX\enregistered

.Li $ Nm echo Qo POSIX.2 Qc | Nm sha1sum Fl c Ar sum Ns Li \&; Nm echo Li $?
.Li $ Nm echo Qo POSIX.2 Qc \&| Nm sha1sum Fl c Ar sum Ns Li \&; Nm echo Li $?
.Li LICENCE : Cm OK
.Li - : Cm OK
.Li UNIX\enregistered : Cm OK


@@ 238,7 241,7 @@ Consider the following shell transcript:

.Li $ Nm rm Ar UNIX* LICENCE
.Li $ Nm ln Fl s Ar LICENCE LICENCE
.Li $ Nm echo Qo POSIX.2 Qc | Nm sha1sum Fl c Ar sum Ns Li \&; Nm echo Li $?
.Li $ Nm echo Qo POSIX.2 Qc \&| Nm sha1sum Fl c Ar sum Ns Li \&; Nm echo Li $?
.Nm sha1sum : Ar sum : Li LICENCE: Too many levels of symbolic links
.Li LICENCE : Cm FAILED (I/O)
.Li - : Cm OK


@@ 247,7 250,7 @@ Consider the following shell transcript:
.Nm sha1sum : Ar sum : Li 1/3 files OK (2 missing, 0 bad lines)
1

.Li $ Nm echo Qo POSIX.2 Qc | Nm sha1sum Fl c -ignore-missing Ar sum Ns Li \&; Nm echo Li $?
.Li $ Nm echo Qo POSIX.2 Qc \&| Nm sha1sum Fl c -ignore-missing Ar sum Ns Li \&; Nm echo Li $?
.Nm sha1sum : Ar sum : Li LICENCE: Too many levels of Cmmbolic links
.Li LICENCE : Cm FAILED (I/O)
.Li - : Cm OK


@@ 255,21 258,21 @@ Consider the following shell transcript:
1

.Li $ Nm sed Fl i Ns Ar B Li 's/22eb73bd/22eb73bd /' Ar sum
.Li $ Nm echo Qo POSIX.2 Qc | Nm sha1sum Fl c -ignore-missing Ar sum Ns Li \&; Nm echo Li $?
.Li $ Nm echo Qo POSIX.2 Qc \&| Nm sha1sum Fl c -ignore-missing Ar sum Ns Li \&; Nm echo Li $?
.Li - : Cm OK
.Nm sha1sum : Ar sum : Li 2/2 files OK (1 missing, 1 bad lines)
0

.Li $ Nm echo Qo POSIX.2 Qc | Nm sha1sum Fl c -ignore-missing -quiet Ar sum Ns Li \&; Nm echo Li $?
.Li $ Nm echo Qo POSIX.2 Qc \&| Nm sha1sum Fl c -ignore-missing -quiet Ar sum Ns Li \&; Nm echo Li $?
.Nm sha1sum : Ar sum : Li 2/2 files OK (1 missing, 1 bad lines)
0

.Li $ Nm echo Qo POSIX.2 Qc | Nm sha1sum Fl cw -ignore-missing -quiet Ar sum Ns Li \&; Nm echo Li $?
.Li $ Nm echo Qo POSIX.2 Qc \&| Nm sha1sum Fl cw -ignore-missing -quiet Ar sum Ns Li \&; Nm echo Li $?
.Nm sha1sum : Ar sum : Li 1: invalid line
.Nm sha1sum : Ar sum : Li 2/2 files OK (1 missing, 1 bad lines)
0

.Li $ Nm echo Qo POSIX.2 Qc | Nm sha1sum Fl cw -ignore-missing -quiet -strict Ar sum Ns Li \&; Nm echo Li $?
.Li $ Nm echo Qo POSIX.2 Qc \&| Nm sha1sum Fl cw -ignore-missing -quiet -strict Ar sum Ns Li \&; Nm echo Li $?
.Nm sha1sum : Ar sum : Li 1: invalid line
.Nm sha1sum : Ar sum : Li 2/2 files OK (1 missing, 1 bad lines)
1

M man1/sha1sum.1.html => man1/sha1sum.1.html +15 -13
@@ 165,29 165,31 @@
    <td><b>Length</b></td>
  </tr>
  <tr>
    <td><b>sha1sum</b></td>
    <td><span class="Li"><b>sha1sum</b></span></td>
    <td>SHA-1</td>
    <td>FIPS PUB 180</td>
    <td>160 bits</td>
    <td>avoid use in security applications</td>
  </tr>
  <tr>
    <td><b>sha224sum</b>, <b>sha256sum</b>,</td>
    <td><span class="Li"><b>sha224sum</b></span>,
      <span class="Li"><b>sha256sum</b></span>,</td>
  </tr>
  <tr>
    <td><b>sha384sum</b>, <b>sha512sum</b></td>
    <td><span class="Li"><b>sha384sum</b></span>,
      <span class="Li"><b>sha512sum</b></span></td>
    <td>SHA-2</td>
    <td>FIPS PUB 180-2</td>
    <td>respective</td>
  </tr>
  <tr>
    <td><b>b2sum</b></td>
    <td><span class="Li"><b>b2sum</b></span></td>
    <td>BLAKE2b</td>
    <td>RFC 7693</td>
    <td>8-512 bits</td>
  </tr>
  <tr>
    <td><b>md5sum</b></td>
    <td><span class="Li"><b>md5sum</b></span></td>
    <td>MD5</td>
    <td>RFC 1321</td>
    <td>128 bits</td>


@@ 201,23 203,23 @@
  form:</p>
<div class="Bd Bd-indent Li">
<pre><code class="Li">$</code> <code class="Nm">sha1sum</code> <code class="Li">README.md</code>
<code class="Li">22eb73bd30d47540a4e05781f0f6e07640857cae</code> <code class="Cm">&#x00A0;</code><var class="Ar">LICENCE</var></pre>
<code class="Li">22eb73bd30d47540a4e05781f0f6e07640857cae</code> <code class="Cm">&#x00A0;</code><var class="Ar">README.md</var></pre>
</div>
With <code class="Fl">-b</code>, an asterisk replaces the second space:
<div class="Bd Bd-indent Li">
<pre><code class="Li">$</code> <code class="Nm">echo</code> &quot;POSIX.2&quot; | <code class="Nm">sha1sum</code> <code class="Fl">-b</code>
<code class="Li">33210013f52127d6ada425601f16bbb62e85f3be</code> <code class="Cm">*</code><var class="Ar">-</var></pre>
<code class="Li">33210013f52127d6ada425601f16bbb62e85f3be</code> <code class="Cm">*</code><span class="Pa">-</span></pre>
</div>
<p class="Pp">With <code class="Fl">--tag</code>, the output is in the form</p>
<div class="Bd Bd-indent Li">
<pre><code class="Li">$</code> <code class="Nm">echo</code> &quot;POSIX.2&quot; | <code class="Nm">sha1sum</code> <code class="Fl">--tag</code> <code class="Li">LICENCE -</code>
<code class="Cm">SHA1</code><code class="Li">(</code><var class="Ar">LICENCE</var><code class="Li">)</code> <code class="Cm">=</code> <code class="Li">bd25664d6e803060dcb31bfdd9642ba9d8a3f1b9</code>
<code class="Cm">SHA1</code><code class="Li">(</code><var class="Ar">-</var><code class="Li">)</code> <code class="Cm">=</code> <code class="Li">33210013f52127d6ada425601f16bbb62e85f3be</code></pre>
<code class="Cm">SHA1</code><code class="Li">(</code><span class="Pa">-</span><code class="Li">)</code> <code class="Cm">=</code> <code class="Li">33210013f52127d6ada425601f16bbb62e85f3be</code></pre>
</div>
A dash and width in bits is appended for non-default digest lengths:
<div class="Bd Bd-indent Li">
<pre><code class="Li">$</code> <code class="Nm">echo</code> &quot;POSIX.2&quot; | <code class="Nm">b2sum</code> <code class="Fl">--tag</code> <code class="Fl">-l</code> <var class="Ar">96</var>
<code class="Cm">BLAKE2b-</code><var class="Ar">96</var><code class="Li">(</code><var class="Ar">-</var><code class="Li">)</code> <code class="Cm">=</code> <code class="Li">386b90bea2a1e566249cdb96</code></pre>
<code class="Cm">BLAKE2b-</code><var class="Ar">96</var><code class="Li">(</code><span class="Pa">-</span><code class="Li">)</code> <code class="Cm">=</code> <code class="Li">386b90bea2a1e566249cdb96</code></pre>
</div>
<p class="Pp" id="n">If the filename contains a backslash or newline characters,
    they're replaced with &quot;<b class="Sy">\\</b>&quot; and


@@ 265,9 267,9 @@ Where <var class="Ar">verdict</var> is either <b class="Sy">OK</b> or
    diagnostics, is suppressed.</p>
<p class="Pp">Consider the following shell transcript:</p>
<div class="Bd Bd-indent Li">
<pre><code class="Li">$</code> <code class="Nm">echo</code> &quot;POSIX.2&quot; | <code class="Nm">sha1sum</code> <code class="Li">LICENCE - &quot;$(printf 'UNIX\nregistered')&quot;</code> | <code class="Nm">tee</code> <var class="Ar">sum</var>
<code class="Li">22eb73bd30d47540a4e05781f0f6e07640857cae</code> <code class="Cm"> </code><var class="Ar">LICENCE</var>
<code class="Li">33210013f52127d6ada425601f16bbb62e85f3be</code> <code class="Cm"> </code><var class="Ar">-</var>
<pre><code class="Li">$</code> <code class="Nm">echo</code> &quot;POSIX.2&quot; | <code class="Nm">sha1sum</code> <code class="Li">LICENCE - &quot;$(printf 'UNIX\nregistered')&quot; |</code> <code class="Nm">tee</code> <var class="Ar">sum</var>
<code class="Li">22eb73bd30d47540a4e05781f0f6e07640857cae</code> <code class="Cm"> </code><span class="Pa">LICENCE</span>
<code class="Li">33210013f52127d6ada425601f16bbb62e85f3be</code> <code class="Cm"> </code><span class="Pa">-</span>
<code class="Cm">\</code><code class="Li">7390a4a0bfb7c6da55d6f5f3db4e42c534271363</code> <code class="Cm"> </code><var class="Ar">UNIX\nregistered</var>

<code class="Li">$</code> <code class="Nm">echo</code> &quot;POSIX.2&quot; | <code class="Nm">sha1sum</code> <code class="Fl">-c</code> <var class="Ar">sum</var><code class="Li">;</code> <code class="Nm">echo</code> <code class="Li">$?</code>


@@ 400,7 402,7 @@ Where <var class="Ar">verdict</var> is either <b class="Sy">OK</b> or
</div>
<table class="foot">
  <tr>
    <td class="foot-date">December 30, 2021</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/shred.1 => man1/shred.1 +2 -2
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd January 20, 2022
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt SHRED 1
.Os voreutils pre-v0.0.0-latest


@@ 13,7 13,7 @@
.Op Fl fvzx
.Op Fl s Ar size
.Op Fl n Ar iterations
.Op Fl u Ns | Ns Fl -remove Ns Op Ns = Ns Ar how
.Op Fl u Ns \&| Ns Fl -remove Ns Op Ns = Ns Ar how
.Op Fl -random-source Ns = Ns Ar path
.Ar file Ns …
.

M man1/shred.1.html => man1/shred.1.html +1 -1
@@ 94,7 94,7 @@ This is laughable, of course.
</div>
<table class="foot">
  <tr>
    <td class="foot-date">January 20, 2022</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/shuf.1 => man1/shuf.1 +4 -2
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 31, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt SHUF 1
.Os voreutils pre-v0.0.0-latest


@@ 106,4 106,6 @@ if a file couldn't be opened, read, or written.
.Sh STANDARDS
Originates from the GNU system, also present in
.Fx .
Multiple input files are an extension.
Multiple
.Ar file Ns s
are an extension.

M man1/shuf.1.html => man1/shuf.1.html +3 -2
@@ 110,12 110,13 @@
<section class="Sh">
<h1 class="Sh" id="STANDARDS"><a class="permalink" href="#STANDARDS">STANDARDS</a></h1>
<p class="Pp">Originates from the GNU system, also present in
    <span class="Ux">FreeBSD</span>. Multiple input files are an extension.</p>
    <span class="Ux">FreeBSD</span>. Multiple <var class="Ar">file</var>s are an
    extension.</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">December 31, 2021</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/sleep.1 => man1/sleep.1 +110 -4
@@ 1,6 1,7 @@
'\" e
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 30, 2021
.Dd April  2, 2022
.ds doc-volume-operating-system
.Dt SLEEP 1
.Os voreutils pre-v0.0.0-latest


@@ 12,8 13,12 @@
.Nm
.Ar delay Ns Oo Sy smhdwy Oc Ns …
.
.EQ
delim %%
.EN
.
.Sh DESCRIPTION
Sleep for the the time(s) specified.
Sleep for the time(s) specified.
.\" Remember to match timeout(1)!
Each
.Ar delay


@@ 30,7 35,7 @@ is a floating-point amount of seconds, optionally suffixed with one of the follo
.It Sy w Ns Pq eeks
.Sy 7
.It Sy y Ns Pq ears
.Sy 365.25 / 7
.Sy 365.25 No / Sy 7
.El
.
.Sh EXAMPLES


@@ 44,7 49,108 @@ Wait a year:
.Pp
Wait infinitely, or until the heat death of the universe:
.Dl Nm Ar INF Ns Sy s
.Dl Nm Ar 10e+100y
.Dl Nm Ar 10e+100 Ns Sy y
.
.Sh SEE ALSO
.Xr nanosleep 2
.
.Sh STANDARDS
Conforms to
.St -p1003.1-2008 ,
which only allows a single non-negative decimal integer
.Ar delay .
Multiple, floating-point
.Ar delay Ns s
and
.Sy smhd
suffixes are extensions, originating from the GNU system.
.Sy wy
suffixes are extensions.
.
.Sh HISTORY
.\" Copied from Unix Programmer's Manual 2nd ed and V3, V4 manpages
.Xr sleep II
.Pq Qq delay execution
appeared in
.At v2 :
.Bl -tag -compact -offset Ds -width ".Li DESCRIPTION"
.It Li NAME
.Li "sleep -\&- stop execution for interval"
.It Li SYNOPSIS
.Li "(60ths of a second in r0)"
.br
.Li "sys sleep  / sleep = 35.; not in assembler"
.El
With the
.Sx BUGS
noting accuracy up to
.ie n .Sy 256 Ns / Ns Sy 60 Ns = Ns Sy 4.2(6)
.el   \{ % { 256 over 60 } = 4.2(6) % \}
seconds, and the process being also placed on a low-priority queue for the duration of the sleep.
.\" Confirmed against v3/nsys
.Pp
.At v3
.Xr sleep II
takes whole seconds, but the precision limitations remain.
.Pp
.At v4
sees full-range
.Xr sleep II ,
and
.Xr sleep I
\(em "suspend execution for an interval",
limited to
.Sy 65536
.Pq 16 bits , Vt unsigned , No but it's more likely actually Sy 32767 , Vt int
seconds
.Pq this is noted in the Sx BUGS , No despite being entirely expected with a 16-bit Va r0 No on a 16-bit machine .
.Pp
.At v7
replaces
.Xr sleep II
with
.Xr ftime 2
and implements
.Xr sleep 3 ,
based on
.Xr alarm 2 ,
.Xr pause 2 ,
and
.Xr longjmp 3 ,
in
.Lb libc ,
but leaves
.Nm
unchanged.
.Pp
.At 32v
just blindly updates the
.Sx BUGS
to say that the max is
.Sy 2147483647
seconds.
Considering this is now 68
.Em years ,
rather than the 18ish hours (or, indeed, 9ish, as the case may be),
this raises question about the fore-seen use-cases.
.Pp
This
.Nm
implementation persists into
.At
and the
.Bx
(but
.At v3
and
.Bx 4.2
cool it on the
.Xr longjmp 3 Ns s
in
.Xr sleep 3 ) ,
and is standardised verbatim in
.Tn X/Open No Portability Guide Issue\~2 Pq Dq Tn XPG Ns \^2 .  \" .St -xpg2
.
.EQ
delim off
.EN

M man1/sleep.1.html => man1/sleep.1.html +90 -7
@@ 1,6 1,7 @@
<!DOCTYPE html>
<html>
<!-- This is an automatically generated file.  Do not edit.
   e
   SPDX-License-Identifier: 0BSD
   -->
<head>


@@ 34,9 35,9 @@
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">Sleep for the the time(s) specified. Each
    <var class="Ar">delay</var> is a floating-point amount of seconds,
    optionally suffixed with one of the following cumulative multipliers:</p>
<p class="Pp">Sleep for the time(s) specified. Each <var class="Ar">delay</var>
    is a floating-point amount of seconds, optionally suffixed with one of the
    following cumulative multipliers:</p>
<div class="Bd-indent">
<dl class="Bl-tag Bl-compact">
  <dt id="s"><a class="permalink" href="#s"><b class="Sy">s</b></a>(econds)</dt>


@@ 50,8 51,8 @@
  <dt id="w"><a class="permalink" href="#w"><b class="Sy">w</b></a>(eeks)</dt>
  <dd><a class="permalink" href="#7"><b class="Sy" id="7">7</b></a></dd>
  <dt id="y"><a class="permalink" href="#y"><b class="Sy">y</b></a>(ears)</dt>
  <dd><a class="permalink" href="#365.25"><b class="Sy" id="365.25">365.25 /
      7</b></a></dd>
  <dd><a class="permalink" href="#365.25"><b class="Sy" id="365.25">365.25</b></a>
      <span class="No">/</span> <b class="Sy">7</b></dd>
</dl>
</div>
</section>


@@ 71,17 72,99 @@
<div class="Bd Bd-indent"><code class="Li"><code class="Nm">sleep</code>
  <var class="Ar">INF</var><b class="Sy">s</b></code></div>
<div class="Bd Bd-indent"><code class="Li"><code class="Nm">sleep</code>
  <var class="Ar">10e+100y</var></code></div>
  <var class="Ar">10e+100</var><b class="Sy">y</b></code></div>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
  ALSO</a></h1>
<p class="Pp"><a class="Xr" href="https://manpages.debian.org/bullseye/nanosleep.2">nanosleep(2)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="STANDARDS"><a class="permalink" href="#STANDARDS">STANDARDS</a></h1>
<p class="Pp">Conforms to <span class="St">IEEE Std 1003.1-2008
    (&#x201C;POSIX.1&#x201D;)</span>, which only allows a single non-negative
    decimal integer <var class="Ar">delay</var>. Multiple, floating-point
    <var class="Ar">delay</var>s and
    <a class="permalink" href="#smhd"><b class="Sy" id="smhd">smhd</b></a>
    suffixes are extensions, originating from the GNU system.
    <a class="permalink" href="#wy"><b class="Sy" id="wy">wy</b></a> suffixes
    are extensions.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp"><a class="Xr" href="https://manpages.debian.org/bullseye/sleep.II">sleep(II)</a>
    (&quot;delay execution&quot;) appeared in <span class="Ux">Version&#x00A0;2
    AT&amp;T UNIX</span>:</p>
<div class="Bd-indent">
<dl class="Bl-tag Bl-compact">
  <dt id="NAME~2"><a class="permalink" href="#NAME~2"><code class="Li">NAME</code></a></dt>
  <dd><a class="permalink" href="#sleep"><code class="Li" id="sleep">sleep --
      stop execution for interval</code></a></dd>
  <dt id="SYNOPSIS~2"><a class="permalink" href="#SYNOPSIS~2"><code class="Li">SYNOPSIS</code></a></dt>
  <dd><a class="permalink" href="#(60ths"><code class="Li" id="(60ths">(60ths of
      a second in r0)</code></a>
    <br/>
    <code class="Li">sys sleep / sleep = 35.; not in assembler</code></dd>
</dl>
</div>
With the <a class="Sx" href="#BUGS">BUGS</a> noting accuracy up to
<math class="eqn">
  <mrow><mrow><mfrac><mn>256</mn><mn>60</mn></mfrac></mrow><mo>=</mo><mn>4.2</mn><mo>(</mo><mn>6</mn><mo>)</mo></mrow>
</math>
seconds, and the process being also placed on a low-priority queue for the
  duration of the sleep.
<p class="Pp"><span class="Ux">Version&#x00A0;3 AT&amp;T UNIX</span>
    <a class="Xr" href="https://manpages.debian.org/bullseye/sleep.II">sleep(II)</a>
    takes whole seconds, but the precision limitations remain.</p>
<p class="Pp" id="65536"><span class="Ux">Version&#x00A0;4 AT&amp;T UNIX</span>
    sees full-range
    <a class="Xr" href="https://manpages.debian.org/bullseye/sleep.II">sleep(II)</a>,
    and
    <a class="Xr" href="https://manpages.debian.org/bullseye/sleep.I">sleep(I)</a>
    &#x2014; &quot;suspend execution for an interval&quot;, limited to
    <a class="permalink" href="#65536"><b class="Sy">65536</b></a> (16 bits,
    <var class="Vt">unsigned</var>, <span class="No">but it's more likely
    actually</span>
    <a class="permalink" href="#32767"><b class="Sy" id="32767">32767</b></a>,
    <var class="Vt">int</var>) seconds (this is noted in the
    <a class="Sx" href="#BUGS">BUGS</a>, <span class="No">despite being entirely
    expected with a 16-bit</span> <var class="Va">r0</var> <span class="No">on a
    16-bit machine</span>).</p>
<p class="Pp"><span class="Ux">Version&#x00A0;7 AT&amp;T UNIX</span> replaces
    <a class="Xr" href="https://manpages.debian.org/bullseye/sleep.II">sleep(II)</a>
    with
    <a class="Xr" href="https://manpages.debian.org/bullseye/ftime.2">ftime(2)</a>
    and implements
    <a class="Xr" href="https://manpages.debian.org/bullseye/sleep.3">sleep(3)</a>,
    based on
    <a class="Xr" href="https://manpages.debian.org/bullseye/alarm.2">alarm(2)</a>,
    <a class="Xr" href="https://manpages.debian.org/bullseye/pause.2">pause(2)</a>,
    and
    <a class="Xr" href="https://manpages.debian.org/bullseye/longjmp.3">longjmp(3)</a>,
    in <span class="Lb">Standard C&#x00A0;Library (libc, -lc)</span>, but leaves
    <code class="Nm">sleep</code> unchanged.</p>
<p class="Pp" id="2147483647"><span class="Ux">Version&#x00A0;7 AT&amp;T
    UNIX/32V</span> just blindly updates the <a class="Sx" href="#BUGS">BUGS</a>
    to say that the max is
    <a class="permalink" href="#2147483647"><b class="Sy">2147483647</b></a>
    seconds. Considering this is now 68
    <a class="permalink" href="#years"><i class="Em" id="years">years</i></a>,
    rather than the 18ish hours (or, indeed, 9ish, as the case may be), this
    raises question about the fore-seen use-cases.</p>
<p class="Pp">This <code class="Nm">sleep</code> implementation persists into
    <span class="Ux">AT&amp;T UNIX</span> and the <span class="Ux">BSD</span>
    (but <span class="Ux">Version&#x00A0;3 AT&amp;T UNIX</span> and
    <span class="Ux">4.2BSD</span> cool it on the
    <a class="Xr" href="https://manpages.debian.org/bullseye/longjmp.3">longjmp(3)</a>s
    in
    <a class="Xr" href="https://manpages.debian.org/bullseye/sleep.3">sleep(3)</a>),
    and is standardised verbatim in X/Open <span class="No">Portability Guide
    Issue&#x00A0;2</span> (&#x201C;XPG2&#x201D;).</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">December 30, 2021</td>
    <td class="foot-date">April 2, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/stdbuf.1 => man1/stdbuf.1 +26 -12
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 30, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt STDBUF 1
.Os voreutils pre-v0.0.0-latest


@@ 11,8 11,8 @@
.Sh SYNOPSIS
.Nm
.Op Fl i Ar size
.Op Fl o Sy L Ns | Ns Ar size
.Op Fl e Sy L Ns | Ns Ar size
.Op Fl o Sy L Ns \&| Ns Ar size
.Op Fl e Sy L Ns \&| Ns Ar size
.Ar program
.Oo Ar args Oc Ns …
.


@@ 50,15 50,28 @@ is specified, the stream is line-buffered.
This is forbidden for the standard input stream as it's meaningless.
.
.Sh OPTIONS
.Bl -tag -compact -width ".Fl o , -output Ns = Ns Sy L Ns | Ns Ar size"
.Bl -tag -compact -width ".Fl o , -output Ns = Ns Sy L Ns \&| Ns Ar size"
.It Fl i , -input Ns = Ns Ar size
Configures buffering for the standard input stream.
.It Fl o , -output Ns = Ns Sy L Ns | Ns Ar size
.It Fl o , -output Ns = Ns Sy L Ns \&| Ns Ar size
Configures buffering for the standard output stream.
.It Fl e , -error Ns = Ns Sy L Ns | Ns Ar size
.It Fl e , -error Ns = Ns Sy L Ns \&| Ns Ar size
Configures buffering for the standard error stream.
.El
.
.Sh ENVIRONMENT
.Bl -tag -compact -width ".Ev LD_PRELOAD"
.It Ev LD_PRELOAD
Appended with a path to
.Xr libstdbuf 3 .
.\" TODO: remove this?
On Darwin,
.Ev DYLD_INSERT_LIBRARIES
is used and
.Ev DYLD_FORCE_FLAT_NAMESPACE Ns = Ns Sy 1
is set, instead.
.El
.
.Sh EXIT STATUS
.Bl -tag -compact -width "All others"
.It Sy 127


@@ 78,14 91,15 @@ returned by
.Sh EXAMPLES
Normally,
.Nm grep
would buffer incoming CIFS connections because the output leads into a pipe.
would buffer incoming CIFS connections because the output leads is a pipe.
By employing
.Nm ,
each connection is printed as soon as it lands in the log:
.Dl Nm tail Fl f Pa /var/log/messages \&| Nm Fl o Ns Ar L Nm grep Li 'DPT=445' \&| Nm cat Fl n
.Dl Nm tail Fl f Pa /var/log/messages Li \&| Nm Fl o Ns Ar L Nm grep Li 'DPT=445' \&| Nm cat Fl n
.
.Sh SEE ALSO
.Xr libstdbuf 3
.Xr libstdbuf 3 ,
.Xr ld.so 8
.
.Sh HISTORY
Originates from the GNU system, also available in


@@ 103,7 117,7 @@ and only supports integer
.Pp
.Fx
supports a simplified
.Sy 0 Ns | Ns Sy L Ns | Ns Sy B Ns | Ns Ar size Ns Op Sy kmG
.Sy 0 Ns \&| Ns Sy L Ns \&| Ns Sy B Ns \&| Ns Ar size Ns Op Sy kmG
buffer size spec
.Pq where Sy B No means Dv BUFSIZ .
.Pp


@@ 111,7 125,7 @@ buffer size spec
includes a similar facility natively in its
.Lb libc
as
.Ev STDBUF Ns Oo Ar n Oc Ns = Ns Sy U Ns | Ns Sy L Ns | Ns Sy F Ns Op Ar size ;
.Ev STDBUF Ns Oo Ar n Oc Ns = Ns Sy U Ns \&| Ns Sy L Ns \&| Ns Sy F Ns Op Ar size ;
the example above could be re-written as
.Dl Nm tail Fl f Pa /var/log/messages \&| Ev STDBUF Ns Ar 1 Ns = Ns Ar L Nm grep Li 'DPT=445' \&| Nm cat Fl n
.Dl Nm tail Fl f Pa /var/log/messages Li \&| Ev STDBUF Ns Ar 1 Ns = Ns Ar L Nm grep Li 'DPT=445' \&| Nm cat Fl n
.\" TODO: actually do this on NetBSD?

M man1/stdbuf.1.html => man1/stdbuf.1.html +19 -6
@@ 74,6 74,17 @@ Where <i class="Em">base</i> is a floating-point amount of bytes, which is then
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="ENVIRONMENT"><a class="permalink" href="#ENVIRONMENT">ENVIRONMENT</a></h1>
<dl class="Bl-tag Bl-compact">
  <dt id="LD_PRELOAD"><a class="permalink" href="#LD_PRELOAD"><code class="Ev">LD_PRELOAD</code></a></dt>
  <dd>Appended with a path to
      <a class="Xr" href="../man3/libstdbuf.3.html">libstdbuf(3)</a>. On Darwin,
      <code class="Ev">DYLD_INSERT_LIBRARIES</code> is used and
      <code class="Ev">DYLD_FORCE_FLAT_NAMESPACE</code>=<a class="permalink" href="#1"><b class="Sy" id="1">1</b></a>
      is set, instead.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="EXIT_STATUS"><a class="permalink" href="#EXIT_STATUS">EXIT
  STATUS</a></h1>
<dl class="Bl-tag Bl-compact">


@@ 91,12 102,12 @@ Where <i class="Em">base</i> is a floating-point amount of bytes, which is then
<section class="Sh">
<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
<p class="Pp">Normally, <code class="Nm">grep</code> would buffer incoming CIFS
    connections because the output leads into a pipe. By employing
    connections because the output leads is a pipe. By employing
    <code class="Nm">stdbuf</code>, each connection is printed as soon as it
    lands in the log:</p>
<div class="Bd Bd-indent"><code class="Li"><code class="Nm">tail</code>
  <code class="Fl">-f</code> <span class="Pa">/var/log/messages |</span>
  <code class="Nm">stdbuf</code>
  <code class="Fl">-f</code> <span class="Pa">/var/log/messages</span>
  <code class="Li">|</code> <code class="Nm">stdbuf</code>
  <code class="Fl">-o</code><var class="Ar">L</var> <code class="Nm">grep</code>
  <code class="Li">'DPT=445' |</code> <code class="Nm">cat</code>
  <code class="Fl">-n</code></code></div>


@@ 104,7 115,8 @@ Where <i class="Em">base</i> is a floating-point amount of bytes, which is then
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
  ALSO</a></h1>
<p class="Pp"><a class="Xr" href="../man3/libstdbuf.3.html">libstdbuf(3)</a></p>
<p class="Pp"><a class="Xr" href="../man3/libstdbuf.3.html">libstdbuf(3)</a>,
    <a class="Xr" href="https://manpages.debian.org/bullseye/ld.so.8">ld.so(8)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>


@@ 124,7 136,8 @@ Where <i class="Em">base</i> is a floating-point amount of bytes, which is then
    <code class="Ev">STDBUF</code>[<var class="Ar">n</var>]=<a class="permalink" href="#U"><b class="Sy">U</b></a>|<b class="Sy">L</b>|<a class="permalink" href="#F"><b class="Sy" id="F">F</b></a>[<var class="Ar">size</var>];
    the example above could be re-written as</p>
<div class="Bd Bd-indent"><code class="Li"><code class="Nm">tail</code>
  <code class="Fl">-f</code> <span class="Pa">/var/log/messages |</span>
  <code class="Fl">-f</code> <span class="Pa">/var/log/messages</span>
  <code class="Li">|</code>
  <code class="Ev">STDBUF</code><var class="Ar">1</var>=<var class="Ar">L</var>
  <code class="Nm">grep</code> <code class="Li">'DPT=445' |</code>
  <code class="Nm">cat</code> <code class="Fl">-n</code></code></div>


@@ 132,7 145,7 @@ Where <i class="Em">base</i> is a floating-point amount of bytes, which is then
</div>
<table class="foot">
  <tr>
    <td class="foot-date">December 30, 2021</td>
    <td class="foot-date">June 23, 2022</td>
    <td class="foot-os">voreutils pre-v0.0.0-latest</td>
  </tr>
</table>

M man1/sum.1 => man1/sum.1 +5 -3
@@ 1,6 1,6 @@
.\" SPDX-License-Identifier: 0BSD
.\"
.Dd December 30, 2021
.Dd June 23, 2022
.ds doc-volume-operating-system
.Dt SUM 1
.Os voreutils pre-v0.0.0-latest


@@ 58,7 58,9 @@ sees a rewrite in C:
it now uses the standard input stream if no files are specified and an updated output format:
the sum is zero-padded to 5 digits and immediately followed by the block count, space-padded to six digits
(this does mean that a file at least 51.2MB in size would end up with no spaces between the sum and the block count,
but is hardly a problem, as disk packs available for the PDP-11 were 10 megabytes in size at the very top end),
but is hardly a problem, as disk packs available for the
.Tn PDP-11
were 10 megabytes in size at the very top end),
followed by a space and filename, if more than one was specified, and a newline.
The algorithm also changed, rotating the accumulator right by one bit before each addition.
.Pp


@@ 95,7 97,7 @@ In
was moved to
.Pa old ,
and the legacy algorithms became available under
.Nm cksum Fl o Ar 1 Ns | Ns Ar 2 ,
.Nm cksum Fl o Ar 1 Ns \&| Ns Ar 2 ,
but algorithm
.Ar 1
\(em

M man1/sum.1.html => man1