libbsd: Branch 'main' - 4 commits
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Aug 3 09:43:17 UTC 2022
COPYING | 33 --------------
man/arc4random.3bsd | 8 +--
man/bitstring.3bsd | 2
man/byteorder.3bsd | 2
man/closefrom.3bsd | 2
man/errc.3bsd | 2
man/expand_number.3bsd | 2
man/explicit_bzero.3bsd | 2
man/fgetln.3bsd | 2
man/fgetwln.3bsd | 2
man/flopen.3bsd | 2
man/fmtcheck.3bsd | 2
man/fparseln.3bsd | 2
man/fpurge.3bsd | 2
man/funopen.3bsd | 2
man/getbsize.3bsd | 2
man/getpeereid.3bsd | 2
man/getprogname.3bsd | 106 +++++++++++++++++++----------------------------
man/heapsort.3bsd | 2
man/humanize_number.3bsd | 2
man/libbsd.7 | 15 +++++-
man/nlist.3bsd | 2
man/pidfile.3bsd | 2
man/pwcache.3bsd | 2
man/queue.3bsd | 2
man/radixsort.3bsd | 2
man/readpassphrase.3bsd | 2
man/reallocarray.3bsd | 2
man/reallocf.3bsd | 2
man/setmode.3bsd | 2
man/setproctitle.3bsd | 2
man/stringlist.3bsd | 2
man/strlcpy.3bsd | 2
man/strmode.3bsd | 2
man/strnstr.3bsd | 2
man/strtoi.3bsd | 2
man/strtonum.3bsd | 2
man/strtou.3bsd | 2
man/timeradd.3bsd | 2
man/timeval.3bsd | 2
man/tree.3bsd | 2
man/unvis.3bsd | 2
man/vis.3bsd | 2
man/wcslcpy.3bsd | 2
src/arc4random.c | 14 ++++--
src/chacha_private.h | 4 -
46 files changed, 114 insertions(+), 146 deletions(-)
New commits:
commit f4baceb82c1de18eed363930632284455ddfec4b
Author: Guillem Jover <guillem at hadrons.org>
Date: Wed Aug 3 03:05:52 2022 +0200
man: Rewrite gerprogname(3bsd) from scratch
This gets rid of one of the last man pages with a BSD-4-clause license.
diff --git a/COPYING b/COPYING
index 18b996a..67223d4 100644
--- a/COPYING
+++ b/COPYING
@@ -37,39 +37,6 @@ License: BSD-4-clause-Niels-Provos
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-Files:
- man/getprogname.3bsd
-Copyright:
- Copyright © 2001 Christopher G. Demetriou
- All rights reserved.
-License: BSD-4-clause-Christopher-G-Demetriou
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. All advertising materials mentioning features or use of this software
- must display the following acknowledgement:
- This product includes software developed for the
- NetBSD Project. See http://www.netbsd.org/ for
- information about NetBSD.
- 4. The name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
- .
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
Files:
include/bsd/err.h
include/bsd/stdlib.h
diff --git a/man/getprogname.3bsd b/man/getprogname.3bsd
index 0c74c64..e933f34 100644
--- a/man/getprogname.3bsd
+++ b/man/getprogname.3bsd
@@ -1,6 +1,4 @@
-.\"
-.\" Copyright (c) 2001 Christopher G. Demetriou
-.\" All rights reserved.
+.\" Copyright (c) 2022 Guillem Jover <guillem at hadrons.org>
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -10,34 +8,27 @@
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed for the
-.\" NetBSD Project. See http://www.netbsd.org/ for
-.\" information about NetBSD.
-.\" 4. The name of the author may not be used to endorse or promote products
+.\" 3. The name of the author may not be used to endorse or promote products
.\" derived from this software without specific prior written permission.
+.\" .
+.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+.\" THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+.\" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+.\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd May 1, 2001
+.Dd August 03, 2022
.Dt getprogname 3bsd
.Os
.Sh NAME
.Nm getprogname ,
.Nm setprogname
-.Nd get or set the program name
+.Nd get and set program name
.Sh LIBRARY
.ds str-Lb-libbsd Utility functions from BSD systems (libbsd, \-lbsd)
.ds doc-str-Lb-libbsd \*[str-Lb-libbsd]
@@ -54,46 +45,39 @@ for include usage.)
.Sh DESCRIPTION
The
.Fn getprogname
-and
-.Fn setprogname
-functions manipulate the name of the current program.
-They are used by error-reporting routines to produce
-consistent output.
-.Pp
-The
-.Fn getprogname
-function returns the name of the program.
-If the name has not been set yet, it will return
-.Dv NULL .
+returns a string with the current program name,
+excluding any directory component.
+The function will return
+.Dv NULL
+if it was unable to get the program name from any known source.
.Pp
The
.Fn setprogname
-function sets the name of the program to be the last component of the
-.Fa progname
-argument.
-Since a pointer to the given string is kept as the program name,
-it should not be modified for the rest of the program's lifetime.
+function sets the current program name,
+stripping any directory component prefix.
+The function will keep a reference to the passed string pointer,
+so it must not be freed or modified while these functions might
+be called.
.Pp
-In
-.Fx ,
-the name of the program is set by the start-up code that is run before
-.Fn main ;
-thus,
-running
-.Fn setprogname
-is not necessary.
-Programs that desire maximum portability should still call it;
-on another operating system,
-these functions may be implemented in a portability library.
-Calling
-.Fn setprogname
-allows the aforementioned library to learn the program name without
-modifications to the start-up code.
+The implementations on most BSDs will try to initialize the program name
+at program startup time, and
+.Nm libbsd
+will try to infer it from various known sources depending on the
+target system.
+But it is not a portable assumption that the program name will be set
+without calling
+.Fn setprogname ,
+so portable programs should always call it after starting up.
.Sh SEE ALSO
-.Xr err 3 ,
-.Xr setproctitle 3bsd
+.Xr setproctitle 3bsd .
.Sh HISTORY
-These functions first appeared in
+The
+.Fn setprogname
+and
+.Fn getprogname
+functions first appeared in
.Nx 1.6 ,
-and made their way into
-.Fx 4.4 .
+.Fx 4.4 ,
+.Dx 2.1
+and
+.Ox 5.4 .
commit f35c5458477ba5c60b00ab1f4b5199296fae3826
Author: Guillem Jover <guillem at hadrons.org>
Date: Wed Aug 3 02:21:16 2022 +0200
man: Lowercase man page title
While using fully uppercase man page titles has been the usual
convention for a very long time, it is rather ugly and something that
some other projects are switching away from.
diff --git a/man/arc4random.3bsd b/man/arc4random.3bsd
index 2f51fde..547bd54 100644
--- a/man/arc4random.3bsd
+++ b/man/arc4random.3bsd
@@ -31,7 +31,7 @@
.\" Manual page, using -mandoc macros
.\"
.Dd $Mdocdate: September 29 2019 $
-.Dt ARC4RANDOM 3bsd
+.Dt arc4random 3bsd
.Os
.Sh NAME
.Nm arc4random ,
diff --git a/man/bitstring.3bsd b/man/bitstring.3bsd
index 6006af0..feb919d 100644
--- a/man/bitstring.3bsd
+++ b/man/bitstring.3bsd
@@ -31,7 +31,7 @@
.\" $FreeBSD$
.\"
.Dd July 19, 1993
-.Dt BITSTRING 3bsd
+.Dt bitstring 3bsd
.Os
.Sh NAME
.Nm bit_alloc ,
diff --git a/man/byteorder.3bsd b/man/byteorder.3bsd
index 5e5d6d3..635a6a1 100644
--- a/man/byteorder.3bsd
+++ b/man/byteorder.3bsd
@@ -25,7 +25,7 @@
.\" $FreeBSD$
.\"
.Dd April 29, 2002
-.Dt BYTEORDER 3bsd
+.Dt byteorder 3bsd
.Os
.Sh NAME
.Nm be16enc , be16dec , be32enc , be32dec , be64enc , be64dec ,
diff --git a/man/closefrom.3bsd b/man/closefrom.3bsd
index b2d3853..9e1b0db 100644
--- a/man/closefrom.3bsd
+++ b/man/closefrom.3bsd
@@ -26,7 +26,7 @@
.\" $FreeBSD$
.\"
.Dd June 12, 2009
-.Dt CLOSEFROM 3bsd
+.Dt closefrom 3bsd
.Os
.Sh NAME
.Nm closefrom
diff --git a/man/errc.3bsd b/man/errc.3bsd
index b330b6b..964a528 100644
--- a/man/errc.3bsd
+++ b/man/errc.3bsd
@@ -28,7 +28,7 @@
.\" SUCH DAMAGE.
.\"
.Dd $Mdocdate: April 23 2014 $
-.Dt ERRC 3bsd
+.Dt errc 3bsd
.Os
.Sh NAME
.Nm errc ,
diff --git a/man/expand_number.3bsd b/man/expand_number.3bsd
index e0ba501..c8050f4 100644
--- a/man/expand_number.3bsd
+++ b/man/expand_number.3bsd
@@ -26,7 +26,7 @@
.\" $FreeBSD$
.\"
.Dd August 15, 2010
-.Dt EXPAND_NUMBER 3bsd
+.Dt expand_number 3bsd
.Os
.Sh NAME
.Nm expand_number
diff --git a/man/explicit_bzero.3bsd b/man/explicit_bzero.3bsd
index ca077b3..5b55dc9 100644
--- a/man/explicit_bzero.3bsd
+++ b/man/explicit_bzero.3bsd
@@ -30,7 +30,7 @@
.\" $OpenBSD: bzero.3,v 1.10 2014/01/22 21:06:45 tedu Exp $
.\"
.Dd $Mdocdate: January 22 2014 $
-.Dt EXPLICIT_BZERO 3bsd
+.Dt explicit_bzero 3bsd
.Os
.Sh NAME
.Nm explicit_bzero
diff --git a/man/fgetln.3bsd b/man/fgetln.3bsd
index c9f7059..685e05f 100644
--- a/man/fgetln.3bsd
+++ b/man/fgetln.3bsd
@@ -29,7 +29,7 @@
.\" $FreeBSD: /repoman/r/ncvs/src/lib/libc/stdio/fgetln.3,v 1.8 2004/07/16 06:07:12 tjr Exp $
.\"
.Dd April 19, 1994
-.Dt FGETLN 3bsd
+.Dt fgetln 3bsd
.Os
.Sh NAME
.Nm fgetln
diff --git a/man/fgetwln.3bsd b/man/fgetwln.3bsd
index 21b8695..0f1f3cb 100644
--- a/man/fgetwln.3bsd
+++ b/man/fgetwln.3bsd
@@ -29,7 +29,7 @@
.\" $FreeBSD$
.\"
.Dd July 16, 2004
-.Dt FGETWLN 3bsd
+.Dt fgetwln 3bsd
.Os
.Sh NAME
.Nm fgetwln
diff --git a/man/flopen.3bsd b/man/flopen.3bsd
index 6ee153c..e0816ba 100644
--- a/man/flopen.3bsd
+++ b/man/flopen.3bsd
@@ -26,7 +26,7 @@
.\" $FreeBSD$
.\"
.Dd July 28, 2017
-.Dt FLOPEN 3bsd
+.Dt flopen 3bsd
.Os
.Sh NAME
.Nm flopen ,
diff --git a/man/fmtcheck.3bsd b/man/fmtcheck.3bsd
index 93e7673..9fb769f 100644
--- a/man/fmtcheck.3bsd
+++ b/man/fmtcheck.3bsd
@@ -27,7 +27,7 @@
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd June 14, 2014
-.Dt FMTCHECK 3bsd
+.Dt fmtcheck 3bsd
.Os
.Sh NAME
.Nm fmtcheck
diff --git a/man/fparseln.3bsd b/man/fparseln.3bsd
index 0f9ebc8..ab8ad7b 100644
--- a/man/fparseln.3bsd
+++ b/man/fparseln.3bsd
@@ -23,7 +23,7 @@
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd November 30, 2002
-.Dt FPARSELN 3bsd
+.Dt fparseln 3bsd
.Os
.Sh NAME
.Nm fparseln
diff --git a/man/fpurge.3bsd b/man/fpurge.3bsd
index eb3fc95..1a7dc58 100644
--- a/man/fpurge.3bsd
+++ b/man/fpurge.3bsd
@@ -32,7 +32,7 @@
.\" SUCH DAMAGE.
.\"
.Dd $Mdocdate: November 4 2015 $
-.Dt FPURGE 3bsd
+.Dt fpurge 3bsd
.Os
.Sh NAME
.Nm fpurge
diff --git a/man/funopen.3bsd b/man/funopen.3bsd
index b322525..6ff61fd 100644
--- a/man/funopen.3bsd
+++ b/man/funopen.3bsd
@@ -31,7 +31,7 @@
.\" $FreeBSD$
.\"
.Dd March 19, 2004
-.Dt FUNOPEN 3bsd
+.Dt funopen 3bsd
.Os
.Sh NAME
.Nm funopen ,
diff --git a/man/getbsize.3bsd b/man/getbsize.3bsd
index d091db3..b371a7f 100644
--- a/man/getbsize.3bsd
+++ b/man/getbsize.3bsd
@@ -29,7 +29,7 @@
.\" $FreeBSD$
.\"
.Dd November 16, 2012
-.Dt GETBSIZE 3bsd
+.Dt getbsize 3bsd
.Os
.Sh NAME
.Nm getbsize
diff --git a/man/getpeereid.3bsd b/man/getpeereid.3bsd
index cce3909..eafa4b4 100644
--- a/man/getpeereid.3bsd
+++ b/man/getpeereid.3bsd
@@ -26,7 +26,7 @@
.\" $FreeBSD$
.\"
.Dd July 15, 2001
-.Dt GETPEEREID 3bsd
+.Dt getpeereid 3bsd
.Os
.Sh NAME
.Nm getpeereid
diff --git a/man/getprogname.3bsd b/man/getprogname.3bsd
index d2a3e34..0c74c64 100644
--- a/man/getprogname.3bsd
+++ b/man/getprogname.3bsd
@@ -32,7 +32,7 @@
.\" $FreeBSD$
.\"
.Dd May 1, 2001
-.Dt GETPROGNAME 3bsd
+.Dt getprogname 3bsd
.Os
.Sh NAME
.Nm getprogname ,
diff --git a/man/heapsort.3bsd b/man/heapsort.3bsd
index 106de56..58c9092 100644
--- a/man/heapsort.3bsd
+++ b/man/heapsort.3bsd
@@ -33,7 +33,7 @@
.\" $FreeBSD$
.\"
.Dd September 30, 2003
-.Dt HEAPSORT 3bsd
+.Dt heapsort 3bsd
.Os
.Sh NAME
.Nm heapsort , mergesort
diff --git a/man/humanize_number.3bsd b/man/humanize_number.3bsd
index ff1db2b..45b1d68 100644
--- a/man/humanize_number.3bsd
+++ b/man/humanize_number.3bsd
@@ -28,7 +28,7 @@
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd February 9, 2008
-.Dt HUMANIZE_NUMBER 3bsd
+.Dt humanize_number 3bsd
.Os
.Sh NAME
.Nm dehumanize_number ,
diff --git a/man/libbsd.7 b/man/libbsd.7
index 2194c81..c9079ac 100644
--- a/man/libbsd.7
+++ b/man/libbsd.7
@@ -25,7 +25,7 @@
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd August 3, 2022
-.Dt LIBBSD 7
+.Dt libbsd 7
.Os
.Sh NAME
.Nm libbsd
diff --git a/man/nlist.3bsd b/man/nlist.3bsd
index beb32a3..fb11d50 100644
--- a/man/nlist.3bsd
+++ b/man/nlist.3bsd
@@ -29,7 +29,7 @@
.\" $FreeBSD: /repoman/r/ncvs/src/lib/libc/gen/nlist.3,v 1.7 2001/10/01 16:08:51 ru Exp $
.\"
.Dd April 19, 1994
-.Dt NLIST 3bsd
+.Dt nlist 3bsd
.Os
.Sh NAME
.Nm nlist
diff --git a/man/pidfile.3bsd b/man/pidfile.3bsd
index 489419b..634ac81 100644
--- a/man/pidfile.3bsd
+++ b/man/pidfile.3bsd
@@ -25,7 +25,7 @@
.\" $FreeBSD$
.\"
.Dd February 8, 2012
-.Dt PIDFILE 3bsd
+.Dt pidfile 3bsd
.Os
.Sh NAME
.Nm pidfile_open ,
diff --git a/man/pwcache.3bsd b/man/pwcache.3bsd
index dac9bcd..366c0b2 100644
--- a/man/pwcache.3bsd
+++ b/man/pwcache.3bsd
@@ -28,7 +28,7 @@
.\" SUCH DAMAGE.
.\"
.Dd $Mdocdate: September 13 2018 $
-.Dt USER_FROM_UID 3
+.Dt user_from_uid 3
.Os
.Sh NAME
.Nm user_from_uid ,
diff --git a/man/queue.3bsd b/man/queue.3bsd
index 46a0503..5128a2c 100644
--- a/man/queue.3bsd
+++ b/man/queue.3bsd
@@ -29,7 +29,7 @@
.\" $FreeBSD$
.\"
.Dd September 8, 2016
-.Dt QUEUE 3bsd
+.Dt queue 3bsd
.Os
.Sh NAME
.Nm SLIST_CLASS_ENTRY ,
diff --git a/man/radixsort.3bsd b/man/radixsort.3bsd
index 306a311..ff0c826 100644
--- a/man/radixsort.3bsd
+++ b/man/radixsort.3bsd
@@ -30,7 +30,7 @@
.\" from: @(#)radixsort.3 8.2 (Berkeley) 1/27/94
.\"
.Dd January 27, 1994
-.Dt RADIXSORT 3bsd
+.Dt radixsort 3bsd
.Os
.Sh NAME
.Nm radixsort ,
diff --git a/man/readpassphrase.3bsd b/man/readpassphrase.3bsd
index 9887eb9..23e5e4c 100644
--- a/man/readpassphrase.3bsd
+++ b/man/readpassphrase.3bsd
@@ -19,7 +19,7 @@
.\" Materiel Command, USAF, under agreement number F39502-99-1-0512.
.\"
.Dd $Mdocdate: March 6 2014 $
-.Dt READPASSPHRASE 3bsd
+.Dt readpassphrase 3bsd
.Os
.Sh NAME
.Nm readpassphrase
diff --git a/man/reallocarray.3bsd b/man/reallocarray.3bsd
index b4e5cbe..f4dbf2b 100644
--- a/man/reallocarray.3bsd
+++ b/man/reallocarray.3bsd
@@ -33,7 +33,7 @@
.\" $OpenBSD: malloc.3,v 1.126 2019/09/14 13:16:50 otto Exp $
.\"
.Dd $Mdocdate: September 14 2019 $
-.Dt REALLOCARRAY 3bsd
+.Dt reallocarray 3bsd
.Os
.Sh NAME
.Nm reallocarray ,
diff --git a/man/reallocf.3bsd b/man/reallocf.3bsd
index 5d8b66d..8509b5e 100644
--- a/man/reallocf.3bsd
+++ b/man/reallocf.3bsd
@@ -33,7 +33,7 @@
.\" $FreeBSD: src/lib/libc/stdlib/malloc.3,v 1.80.2.2.2.1 2010/06/14 02:09:06 kensmith Exp $
.\"
.Dd September 26, 2009
-.Dt REALLOCF 3bsd
+.Dt reallocf 3bsd
.Os
.Sh NAME
.Nm reallocf
diff --git a/man/setmode.3bsd b/man/setmode.3bsd
index 0710f2a..6177a0f 100644
--- a/man/setmode.3bsd
+++ b/man/setmode.3bsd
@@ -31,7 +31,7 @@
.\" $FreeBSD: src/lib/libc/gen/setmode.3,v 1.12 2007/01/09 00:27:55 imp Exp $
.\"
.Dd January 4, 2009
-.Dt SETMODE 3bsd
+.Dt setmode 3bsd
.Os
.Sh NAME
.Nm getmode ,
diff --git a/man/setproctitle.3bsd b/man/setproctitle.3bsd
index ad1f44f..4d3290a 100644
--- a/man/setproctitle.3bsd
+++ b/man/setproctitle.3bsd
@@ -21,7 +21,7 @@
.\"
.\" The following requests are required for all man pages.
.Dd December 16, 1995
-.Dt SETPROCTITLE 3bsd
+.Dt setproctitle 3bsd
.Os
.Sh NAME
.Nm setproctitle
diff --git a/man/stringlist.3bsd b/man/stringlist.3bsd
index d5c0756..ec06b1a 100644
--- a/man/stringlist.3bsd
+++ b/man/stringlist.3bsd
@@ -27,7 +27,7 @@
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd May 6, 2010
-.Dt STRINGLIST 3bsd
+.Dt stringlist 3bsd
.Os
.Sh NAME
.Nm stringlist ,
diff --git a/man/strlcpy.3bsd b/man/strlcpy.3bsd
index fd5d71d..19aaa75 100644
--- a/man/strlcpy.3bsd
+++ b/man/strlcpy.3bsd
@@ -15,7 +15,7 @@
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: May 31 2007 $
-.Dt STRLCPY 3bsd
+.Dt strlcpy 3bsd
.Os
.Sh NAME
.Nm strlcpy ,
diff --git a/man/strmode.3bsd b/man/strmode.3bsd
index 224e099..7f613a2 100644
--- a/man/strmode.3bsd
+++ b/man/strmode.3bsd
@@ -29,7 +29,7 @@
.\" $FreeBSD: src/lib/libc/string/strmode.3,v 1.9 2003/07/01 15:28:05 maxim Exp $
.\"
.Dd July 28, 1994
-.Dt STRMODE 3bsd
+.Dt strmode 3bsd
.Os
.Sh NAME
.Nm strmode
diff --git a/man/strnstr.3bsd b/man/strnstr.3bsd
index e7a116d..44756e6 100644
--- a/man/strnstr.3bsd
+++ b/man/strnstr.3bsd
@@ -34,7 +34,7 @@
.\" $FreeBSD$
.\"
.Dd October 11, 2001
-.Dt STRSTR 3bsd
+.Dt strstr 3bsd
.Os
.Sh NAME
.Nm strnstr
diff --git a/man/strtoi.3bsd b/man/strtoi.3bsd
index 80aab7b..0e63da1 100644
--- a/man/strtoi.3bsd
+++ b/man/strtoi.3bsd
@@ -37,7 +37,7 @@
.\" NetBSD: strtol.3,v 1.31 2015/03/11 09:57:35 wiz Exp
.\"
.Dd November 13, 2015
-.Dt STRTOI 3bsd
+.Dt strtoi 3bsd
.Os
.Sh NAME
.Nm strtoi
diff --git a/man/strtonum.3bsd b/man/strtonum.3bsd
index d216d00..44107b1 100644
--- a/man/strtonum.3bsd
+++ b/man/strtonum.3bsd
@@ -16,7 +16,7 @@
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd January 18, 2015
-.Dt STRTONUM 3bsd
+.Dt strtonum 3bsd
.Os
.Sh NAME
.Nm strtonum
diff --git a/man/strtou.3bsd b/man/strtou.3bsd
index 09cc458..fe46bd1 100644
--- a/man/strtou.3bsd
+++ b/man/strtou.3bsd
@@ -37,7 +37,7 @@
.\" NetBSD: strtoul.3,v 1.29 2015/03/10 13:00:58 christos Exp
.\"
.Dd November 13, 2015
-.Dt STRTOU 3bsd
+.Dt strtou 3bsd
.Os
.Sh NAME
.Nm strtou
diff --git a/man/timeradd.3bsd b/man/timeradd.3bsd
index e9e78e9..2dd43c5 100644
--- a/man/timeradd.3bsd
+++ b/man/timeradd.3bsd
@@ -31,7 +31,7 @@
.\" $FreeBSD: src/share/man/man3/timeradd.3,v 1.3 2003/09/08 19:57:19 ru Exp $
.\"
.Dd June 7, 2010
-.Dt TIMERADD 3bsd
+.Dt timeradd 3bsd
.Os
.Sh NAME
.Nm timeradd ,
diff --git a/man/timeval.3bsd b/man/timeval.3bsd
index 31431a3..59613e1 100644
--- a/man/timeval.3bsd
+++ b/man/timeval.3bsd
@@ -28,7 +28,7 @@
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd April 12, 2011
-.Dt TIMEVAL 3bsd
+.Dt timeval 3bsd
.Os
.Sh NAME
.Nm timeval ,
diff --git a/man/tree.3bsd b/man/tree.3bsd
index aa8a724..2bd4f17 100644
--- a/man/tree.3bsd
+++ b/man/tree.3bsd
@@ -24,7 +24,7 @@
.\" * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" */
.Dd May 10, 2019
-.Dt TREE 3bsd
+.Dt tree 3bsd
.Os
.Sh NAME
.Nm SPLAY_PROTOTYPE ,
diff --git a/man/unvis.3bsd b/man/unvis.3bsd
index 22ed7c9..fd3f729 100644
--- a/man/unvis.3bsd
+++ b/man/unvis.3bsd
@@ -30,7 +30,7 @@
.\" @(#)unvis.3 8.2 (Berkeley) 12/11/93
.\"
.Dd March 12, 2011
-.Dt UNVIS 3bsd
+.Dt unvis 3bsd
.Os
.Sh NAME
.Nm unvis ,
diff --git a/man/vis.3bsd b/man/vis.3bsd
index 7895af4..56d520a 100644
--- a/man/vis.3bsd
+++ b/man/vis.3bsd
@@ -30,7 +30,7 @@
.\" @(#)vis.3 8.1 (Berkeley) 6/9/93
.\"
.Dd April 22, 2017
-.Dt VIS 3bsd
+.Dt vis 3bsd
.Os
.Sh NAME
.Nm vis ,
diff --git a/man/wcslcpy.3bsd b/man/wcslcpy.3bsd
index c112ff3..f7ed5a2 100644
--- a/man/wcslcpy.3bsd
+++ b/man/wcslcpy.3bsd
@@ -36,7 +36,7 @@
.\" $FreeBSD$
.\"
.Dd March 4, 2009
-.Dt WCSLCPY 3bsd
+.Dt wcslcpy 3bsd
.Os
.Sh NAME
.Nm wcslcat ,
commit b466b14afb7645d06823982e7695f63cfa1e075c
Author: Guillem Jover <guillem at hadrons.org>
Date: Wed Aug 3 01:23:09 2022 +0200
man: Document that some arc4random(3) functions are now in glibc 2.36
diff --git a/man/libbsd.7 b/man/libbsd.7
index 869dfa9..2194c81 100644
--- a/man/libbsd.7
+++ b/man/libbsd.7
@@ -24,7 +24,7 @@
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd Mar 30, 2022
+.Dd August 3, 2022
.Dt LIBBSD 7
.Os
.Sh NAME
@@ -240,6 +240,17 @@ This function is provided by
2.26, and
.Nm musl
1.2.2.
+.It Fn arc4random 3
+.It Fn arc4random_buf 3
+.It Fn arc4random_uniform 3
+These functions are provided by
+.Nm glibc
+2.36.
+Note that it does not provide the
+.Fn arc4random_stir 3
+and
+.Fn arc4random_addrandom 3
+functions.
.El
.Sh SEE ALSO
.Xr arc4random 3bsd ,
commit 1f6a48b209d9d494070bb1446b6b5c49bfaa31ba
Author: Guillem Jover <guillem at hadrons.org>
Date: Wed Aug 3 02:03:05 2022 +0200
Sync arc4random(3) implementation from OpenBSD
Closes: #12
diff --git a/man/arc4random.3bsd b/man/arc4random.3bsd
index c509a8e..2f51fde 100644
--- a/man/arc4random.3bsd
+++ b/man/arc4random.3bsd
@@ -1,4 +1,4 @@
-.\" $OpenBSD: arc4random.3,v 1.34 2014/07/19 16:11:16 naddy Exp $
+.\" $OpenBSD: arc4random.3,v 1.37 2019/09/29 16:30:35 jmc Exp $
.\"
.\" Copyright 1997 Niels Provos <provos at physnet.uni-hamburg.de>
.\" All rights reserved.
@@ -30,7 +30,7 @@
.\"
.\" Manual page, using -mandoc macros
.\"
-.Dd $Mdocdate: July 19 2014 $
+.Dd $Mdocdate: September 29 2019 $
.Dt ARC4RANDOM 3bsd
.Os
.Sh NAME
@@ -39,7 +39,7 @@
.Nm arc4random_uniform ,
.Nm arc4random_stir ,
.Nm arc4random_addrandom
-.Nd arc4 random number generator
+.Nd random number generator
.Sh LIBRARY
.ds str-Lb-libbsd Utility functions from BSD systems (libbsd, \-lbsd)
.ds doc-str-Lb-libbsd \*[str-Lb-libbsd]
diff --git a/src/arc4random.c b/src/arc4random.c
index 1a7b72f..b046a82 100644
--- a/src/arc4random.c
+++ b/src/arc4random.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arc4random.c,v 1.53 2015/09/10 18:53:50 bcook Exp $ */
+/* $OpenBSD: arc4random.c,v 1.58 2022/07/31 13:41:45 tb Exp $ */
/*
* Copyright (c) 1996, David Mazieres <dm at uun.org>
@@ -50,6 +50,8 @@
#define BLOCKSZ 64
#define RSBUFSZ (16*BLOCKSZ)
+#define REKEY_BASE (1024*1024) /* NB. should be a power of 2 */
+
/* Marked MAP_INHERIT_ZERO, so zero'd out in fork children. */
static struct _rs {
size_t rs_have; /* valid bytes at end of rs_buf */
@@ -74,10 +76,10 @@ _rs_init(unsigned char *buf, size_t n)
if (rs == NULL) {
if (_rs_allocate(&rs, &rsx) == -1)
- abort();
+ _exit(1);
}
- chacha_keysetup(&rsx->rs_chacha, buf, KEYSZ * 8, 0);
+ chacha_keysetup(&rsx->rs_chacha, buf, KEYSZ * 8);
chacha_ivsetup(&rsx->rs_chacha, buf + KEYSZ);
}
@@ -108,6 +110,7 @@ static void
_rs_stir(void)
{
unsigned char rnd[KEYSZ + IVSZ];
+ uint32_t rekey_fuzz = 0;
if (getentropy(rnd, sizeof rnd) == -1)
_getentropy_fail();
@@ -122,7 +125,10 @@ _rs_stir(void)
rs->rs_have = 0;
memset(rsx->rs_buf, 0, sizeof(rsx->rs_buf));
- rs->rs_count = 1600000;
+ /* rekey interval should not be predictable */
+ chacha_encrypt_bytes(&rsx->rs_chacha, (uint8_t *)&rekey_fuzz,
+ (uint8_t *)&rekey_fuzz, sizeof(rekey_fuzz));
+ rs->rs_count = REKEY_BASE + (rekey_fuzz % REKEY_BASE);
}
static inline void
diff --git a/src/chacha_private.h b/src/chacha_private.h
index 3b4ec93..ef1b931 100644
--- a/src/chacha_private.h
+++ b/src/chacha_private.h
@@ -4,7 +4,7 @@ D. J. Bernstein
Public domain.
*/
-/* $OpenBSD: chacha_private.h,v 1.2 2013/10/04 07:02:27 djm Exp $ */
+/* $OpenBSD: chacha_private.h,v 1.3 2022/02/28 21:56:29 dtucker Exp $ */
typedef unsigned char u8;
typedef unsigned int u32;
@@ -52,7 +52,7 @@ static const char sigma[16] = "expand 32-byte k";
static const char tau[16] = "expand 16-byte k";
static void
-chacha_keysetup(chacha_ctx *x,const u8 *k,u32 kbits,u32 ivbits)
+chacha_keysetup(chacha_ctx *x,const u8 *k,u32 kbits)
{
const char *constants;
More information about the libbsd
mailing list