libbsd: Branch 'main' - 3 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Mar 30 21:08:52 UTC 2022


 COPYING                  |    3 --
 man/libbsd.7             |   12 ++++++---
 src/Makefile.am          |    1 
 src/arc4random.h         |    4 ---
 src/arc4random_openbsd.h |   61 -----------------------------------------------
 src/local-elf.h          |   10 +++++++
 6 files changed, 20 insertions(+), 71 deletions(-)

New commits:
commit 15200ec7ac97e3f169b6c2f378f0ec2f94663c9f
Author: WANG Xuerui <git at xen0n.name>
Date:   Sat Sep 11 12:54:28 2021 +0800

    Add LoongArch support to nlist()
    
    Closes: !13
    Signed-off-by: WANG Xuerui <git at xen0n.name>
    Signed-off-by: Guillem Jover <guillem at hadrons.org>

diff --git a/src/local-elf.h b/src/local-elf.h
index 98a2962..1dd3b42 100644
--- a/src/local-elf.h
+++ b/src/local-elf.h
@@ -124,6 +124,16 @@
 #define ELF_TARG_CLASS	ELFCLASS64
 #define ELF_TARG_DATA	ELFDATA2LSB
 
+#elif defined(__loongarch__)
+
+#define ELF_TARG_MACH	EM_LOONGARCH
+#if defined(__loongarch64)
+#define ELF_TARG_CLASS	ELFCLASS64
+#else
+#error Unsupported ELF class
+#endif
+#define ELF_TARG_DATA	ELFDATA2LSB
+
 #elif defined(__m32r__)
 
 #define ELF_TARG_MACH	EM_M32R
commit f7465b93ec9fcb473df04e997067476ed2e7fd14
Author: Guillem Jover <guillem at hadrons.org>
Date:   Wed Mar 30 22:56:43 2022 +0200

    man: Document when functions were added to musl in libbsd(7)
    
    The explicit_bzero(3) and reallocarray(3) functions are also present on
    musl libc, mention it in the superseded section.

diff --git a/COPYING b/COPYING
index 7fd11fa..18b996a 100644
--- a/COPYING
+++ b/COPYING
@@ -3,7 +3,7 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Files:
  *
 Copyright:
- Copyright © 2004-2006, 2008-2021 Guillem Jover <guillem at hadrons.org>
+ Copyright © 2004-2006, 2008-2022 Guillem Jover <guillem at hadrons.org>
 License: BSD-3-clause
 
 Files:
diff --git a/man/libbsd.7 b/man/libbsd.7
index 9710a13..ff1ef1f 100644
--- a/man/libbsd.7
+++ b/man/libbsd.7
@@ -1,6 +1,6 @@
 .\" libbsd man page
 .\"
-.\" Copyright © 2017-2021 Guillem Jover <guillem at hadrons.org>
+.\" Copyright © 2017-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
@@ -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 Feb 13, 2021
+.Dd Mar 30, 2022
 .Dt LIBBSD 7
 .Os
 .Sh NAME
@@ -230,11 +230,15 @@ companion library, so it is advised to switch to use that directly instead.
 .It Fn explicit_bzero 3
 This function is provided by
 .Nm glibc
-2.25.
+2.25, and
+.Nm musl
+1.1.20.
 .It Fn reallocarray 3
 This function is provided by
 .Nm glibc
-2.26.
+2.26, and
+.Nm musl
+1.2.2.
 .El
 .Sh SEE ALSO
 .Xr arc4random 3bsd ,
commit e5ed5fdd62aeec980dfeb596b191f7deeb364030
Author: Guilherme Janczak <guilherme.janczak at yandex.com>
Date:   Fri Dec 31 08:25:08 2021 +0000

    Remove arc4random() OpenBSD support
    
    The arc4random() support for OpenBSD does not build. The intention was
    to include any portability code so that the library could be easily
    ported to such systems, but it makes little sense to build it on OpenBSD
    where most of the functionality will be already present, or the software
    would have been ported anyway.
    
    [guillem at hadrons.org: Reword commit message to add rationale. ]
    
    Closes: !15
    Signed-off-by: Guillem Jover <guillem at hadrons.org>

diff --git a/COPYING b/COPYING
index c225ede..7fd11fa 100644
--- a/COPYING
+++ b/COPYING
@@ -364,7 +364,6 @@ Files:
  man/strtonum.3bsd
  src/arc4random.c
  src/arc4random_linux.h
- src/arc4random_openbsd.h
  src/arc4random_uniform.c
  src/arc4random_unix.h
  src/arc4random_win.h
diff --git a/src/Makefile.am b/src/Makefile.am
index ea0bdbe..7cf4a09 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -66,7 +66,6 @@ libbsd_la_SOURCES = \
 	arc4random.c \
 	arc4random.h \
 	arc4random_linux.h \
-	arc4random_openbsd.h \
 	arc4random_uniform.c \
 	arc4random_unix.h \
 	arc4random_win.h \
diff --git a/src/arc4random.h b/src/arc4random.h
index 812188b..b8675b4 100644
--- a/src/arc4random.h
+++ b/src/arc4random.h
@@ -32,9 +32,7 @@
 int
 getentropy(void *buf, size_t len);
 
-#if defined(__OpenBSD__)
-#include "arc4random_openbsd.h"
-#elif defined(__linux__)
+#if defined(__linux__)
 #include "arc4random_linux.h"
 #elif defined(_WIN32)
 #include "arc4random_win.h"
diff --git a/src/arc4random_openbsd.h b/src/arc4random_openbsd.h
deleted file mode 100644
index 9cd8b68..0000000
--- a/src/arc4random_openbsd.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*	$OpenBSD: arc4random.h,v 1.3 2014/07/20 20:51:13 bcook Exp $	*/
-
-/*
- * Copyright (c) 1996, David Mazieres <dm at uun.org>
- * Copyright (c) 2008, Damien Miller <djm at openbsd.org>
- * Copyright (c) 2013, Markus Friedl <markus at openbsd.org>
- * Copyright (c) 2014, Theo de Raadt <deraadt at openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * Stub functions for portability.
- */
-#include <sys/mman.h>
-
-#include <signal.h>
-
-#include "thread_private.h"
-
-static inline void
-_getentropy_fail(void)
-{
-	raise(SIGKILL);
-}
-
-static inline int
-_rs_allocate(struct _rs **rsp, struct _rsx **rsxp)
-{
-	struct {
-		struct _rs rs;
-		struct _rsx rsx;
-	} *p;
-
-	if ((p = mmap(NULL, sizeof(*p), PROT_READ|PROT_WRITE,
-	    MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED)
-		return (-1);
-	if (minherit(p, sizeof(*p), MAP_INHERIT_ZERO) == -1) {
-		munmap(p, sizeof(*p));
-		return (-1);
-	}
-
-	*rsp = &p->rs;
-	*rsxp = &p->rsx;
-	return (0);
-}
-
-static inline void
-_rs_forkdetect(void)
-{
-}


More information about the libbsd mailing list