libbsd: Branch 'main' - 4 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 8 23:02:21 UTC 2024


 include/bsd/vis.h |    2 -
 man/funopen.3bsd  |    9 +++----
 man/libbsd.7      |   69 +++++++++++++++++++++++++++++++-----------------------
 src/unvis.c       |    2 -
 src/vis.c         |    2 -
 5 files changed, 47 insertions(+), 37 deletions(-)

New commits:
commit 97b0fe84b855eb8e7eeffaa2f5aacee543bf9fb2
Author: Guillem Jover <guillem at hadrons.org>
Date:   Mon Jan 8 23:57:45 2024 +0100

    man: Mention that funopen() can be made available on musl
    
    As musl got fopencookie() implemented in 1.1.19, the funopen() function
    can also be provided there. Note this in the documentation.

diff --git a/man/funopen.3bsd b/man/funopen.3bsd
index 0f5ac06..234922f 100644
--- a/man/funopen.3bsd
+++ b/man/funopen.3bsd
@@ -168,11 +168,10 @@ functions first appeared in
 .Sh BUGS
 The
 .Fn funopen
-function
-may not be portable to systems other than
-.Bx
-and glibc-based (as the libbsd implementation is only provided when the
-system has
+function may not be portable to systems other than
+.Bx ,
+glibc- and musl-based ones
+(as the libbsd implementation is only provided when the system has
 .Fn fopencookie
 available).
 .Pp
diff --git a/man/libbsd.7 b/man/libbsd.7
index ee01c9a..b3c848e 100644
--- a/man/libbsd.7
+++ b/man/libbsd.7
@@ -200,7 +200,7 @@ and
 .St -p1003.1-2001 .
 .It Xr funopen 3bsd
 Unportable, requires assistance from the stdio layer or some hook framework.
-On GNU systems the
+On glibc- and musl-based systems the
 .Xr fopencookie 3
 function can be used.
 Otherwise the code needs to be prepared for neither of these functions being
commit e87ae3be195a84272ce422694761fc6d414581d1
Author: Guillem Jover <guillem at hadrons.org>
Date:   Mon Jan 8 23:40:31 2024 +0100

    man: Fix manual page references
    
    When referring to another manual page and their section number, we need
    to use Xr instead of Fn, otherwise the section number is interpreted as
    a function argument. For functions provided by libbsd itself we should
    be using the 3bsd section instead of 3.

diff --git a/man/libbsd.7 b/man/libbsd.7
index c239d5f..ee01c9a 100644
--- a/man/libbsd.7
+++ b/man/libbsd.7
@@ -76,7 +76,7 @@ The package also provides a
 .Nm libbsd-ctor
 static library that can be used to inject automatic constructors into a
 program so that the
-.Xr setproctitle_init 3
+.Xr setproctitle_init 3bsd
 function gets invoked automatically at startup time.
 This can be done with the
 .Xr pkgconf 1
@@ -136,13 +136,13 @@ at build-time.
 This is the list of functions that provide multiple implementations:
 .Pp
 .Bl -tag -width 4m -compact
-.It Fn strnvis 3
-.It Fn strnunvis 3
+.It Xr strnvis 3bsd
+.It Xr strnunvis 3bsd
 .Nx
 added
-.Xr strnvis 3
+.Xr strnvis 3bsd
 and
-.Xr strnunvis 3
+.Xr strnunvis 3bsd
 but unfortunately made it incompatible with the existing one in
 .Ox
 and Freedesktop's libbsd (the former having existed for over ten years).
@@ -156,7 +156,7 @@ Provide both implementations and default for now to the historical one to
 avoid breakage, but we will switch to the
 .Nx
 one in a later release, which is internally consistent with the other
-.Xr vis 3
+.Xr vis 3bsd
 functions and is now more widespread.
 Define
 .Dv LIBBSD_NETBSD_VIS
@@ -178,7 +178,7 @@ or non-buggy way; or because there are better more portable replacements now.
 .Pp
 This is the list of currently deprecated macros and functions:
 .Bl -tag -width 4m
-.It Fn fgetln 3
+.It Xr fgetln 3bsd
 Unportable, requires assistance from the stdio layer.
 An implementation has to choose between leaking buffers or being reentrant
 for a limited amount of streams (this implementation chose the latter with
@@ -187,7 +187,7 @@ Use
 .Xr getline 3
 instead, which is available in many systems and required by
 .St -p1003.1-2008 .
-.It Fn fgetwln 3
+.It Xr fgetwln 3bsd
 Unportable, requires assistance from the stdio layer.
 An implementation has to choose between leaking buffers or being reentrant
 for a limited amount of streams (this implementation chose the latter with
@@ -198,7 +198,7 @@ instead, which is available in many systems and required by
 .St -isoC-99
 and
 .St -p1003.1-2001 .
-.It Fn funopen 3
+.It Xr funopen 3bsd
 Unportable, requires assistance from the stdio layer or some hook framework.
 On GNU systems the
 .Xr fopencookie 3
@@ -215,26 +215,26 @@ are present in all major
 for example.
 .Pp
 .Bl -tag -width 4m -compact
-.It Fn MD5Init 3
-.It Fn MD5Update 3
-.It Fn MD5Pad 3
-.It Fn MD5Final 3
-.It Fn MD5Transform 3
-.It Fn MD5End 3
-.It Fn MD5File 3
-.It Fn MD5FileChunk 3
-.It Fn MD5Data 3
+.It Xr MD5Init 3
+.It Xr MD5Update 3
+.It Xr MD5Pad 3
+.It Xr MD5Final 3
+.It Xr MD5Transform 3
+.It Xr MD5End 3
+.It Xr MD5File 3
+.It Xr MD5FileChunk 3
+.It Xr MD5Data 3
 The set of MD5 digest functions are now proxies for the implementations
 provided by the
 .Nm libmd
 companion library, so it is advised to switch to use that directly instead.
-.It Fn explicit_bzero 3
+.It Xr explicit_bzero 3bsd
 This function is provided by
 .Nm glibc
 2.25, and
 .Nm musl
 1.1.20.
-.It Fn reallocarray 3
+.It Xr reallocarray 3bsd
 This function is provided by
 .Nm glibc
 2.26, and
@@ -244,16 +244,16 @@ This function is provided by
 This function is provided by
 .Nm glibc
 2.34.
-.It Xr arc4random 3
-.It Xr arc4random_buf 3
-.It Xr arc4random_uniform 3
+.It Xr arc4random 3bsd
+.It Xr arc4random_buf 3bsd
+.It Xr arc4random_uniform 3bsd
 These functions are provided by
 .Nm glibc
 2.36.
 Note that it does not provide the
-.Xr arc4random_stir 3
+.Xr arc4random_stir 3bsd
 and
-.Xr arc4random_addrandom 3
+.Xr arc4random_addrandom 3bsd
 functions.
 .It Xr strlcpy 3bsd
 .It Xr strlcat 3bsd
commit 9275d134e5f6101a4cf2e31cd2298605afe0a052
Author: Guillem Jover <guillem at hadrons.org>
Date:   Mon Jan 8 23:39:19 2024 +0100

    man: Add closefrom(), strlcpy() and strlcat() as superseded functions
    
    These were missing from the list of functions provided by some libc
    implementation.

diff --git a/man/libbsd.7 b/man/libbsd.7
index 5d498cd..c239d5f 100644
--- a/man/libbsd.7
+++ b/man/libbsd.7
@@ -1,6 +1,6 @@
 .\" libbsd man page
 .\"
-.\" Copyright © 2017-2022 Guillem Jover <guillem at hadrons.org>
+.\" Copyright © 2017-2024 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
@@ -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 August 3, 2022
+.Dd January 8, 2024
 .Dt libbsd 7
 .Os
 .Sh NAME
@@ -240,6 +240,10 @@ This function is provided by
 2.26, and
 .Nm musl
 1.2.2.
+.It Xr closefrom 3bsd
+This function is provided by
+.Nm glibc
+2.34.
 .It Xr arc4random 3
 .It Xr arc4random_buf 3
 .It Xr arc4random_uniform 3
@@ -251,6 +255,13 @@ Note that it does not provide the
 and
 .Xr arc4random_addrandom 3
 functions.
+.It Xr strlcpy 3bsd
+.It Xr strlcat 3bsd
+These functions are provided by
+.Nm glibc
+2.38, and
+.Nm musl
+0.5.0.
 .El
 .Sh SEE ALSO
 .Xr arc4random 3bsd ,
commit 304a1f831c4132780bb47433d76e6169872cefbc
Author: Guillem Jover <guillem at hadrons.org>
Date:   Mon Jan 8 23:37:43 2024 +0100

    doc: Use macOS to refer to the operating system
    
    This is the correct spelling, instead of capitalizing it.

diff --git a/include/bsd/vis.h b/include/bsd/vis.h
index fb9ad27..dd150d7 100644
--- a/include/bsd/vis.h
+++ b/include/bsd/vis.h
@@ -93,7 +93,7 @@
  * existing one in OpenBSD and Freedesktop's libbsd (the former having existed
  * for over ten years). Despite this incompatibility being reported during
  * development (see http://gnats.netbsd.org/44977) they still shipped it.
- * Even more unfortunately FreeBSD and later MacOS picked up this incompatible
+ * Even more unfortunately FreeBSD and later macOS picked up this incompatible
  * implementation.
  *
  * Provide both implementations and default for now on the historical one to
diff --git a/man/libbsd.7 b/man/libbsd.7
index d4a2d42..5d498cd 100644
--- a/man/libbsd.7
+++ b/man/libbsd.7
@@ -150,7 +150,7 @@ Despite this incompatibility being reported during development (see
 http://gnats.netbsd.org/44977) they still shipped it.
 Even more unfortunately
 .Fx
-and later MacOS picked up this incompatible implementation.
+and later macOS picked up this incompatible implementation.
 .Pp
 Provide both implementations and default for now to the historical one to
 avoid breakage, but we will switch to the
diff --git a/src/unvis.c b/src/unvis.c
index 0f40a27..9c29f9e 100644
--- a/src/unvis.c
+++ b/src/unvis.c
@@ -554,7 +554,7 @@ strunvis(char *dst, const char *src)
  * existing one in OpenBSD and Freedesktop's libbsd (the former having existed
  * for over ten years). Despite this incompatibility being reported during
  * development (see http://gnats.netbsd.org/44977) they still shipped it.
- * Even more unfortunately FreeBSD and later MacOS picked up this incompatible
+ * Even more unfortunately FreeBSD and later macOS picked up this incompatible
  * implementation.
  *
  * Provide both implementations and default for now on the historical one to
diff --git a/src/vis.c b/src/vis.c
index f6261bc..1a18a57 100644
--- a/src/vis.c
+++ b/src/vis.c
@@ -723,7 +723,7 @@ strvis(char *mbdst, const char *mbsrc, int flags)
  * existing one in OpenBSD and Freedesktop's libbsd (the former having existed
  * for over ten years). Despite this incompatibility being reported during
  * development (see http://gnats.netbsd.org/44977) they still shipped it.
- * Even more unfortunately FreeBSD and later MacOS picked up this incompatible
+ * Even more unfortunately FreeBSD and later macOS picked up this incompatible
  * implementation.
  *
  * Provide both implementations and default for now on the historical one to


More information about the libbsd mailing list