summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2022-11-28 09:37:12 -0500
committerDavid Goulet <dgoulet@torproject.org>2022-11-28 09:37:12 -0500
commit21121eb23103b74692607d7001ad53e871811fd6 (patch)
tree045b98529483c2e7462436568e884c866da7607c /src/lib
parentc408d0a7f97e96491d4eae1ec21043c85716abd2 (diff)
parent642e56bdb640150804286d1c60fdae36796bc14b (diff)
downloadtor-21121eb23103b74692607d7001ad53e871811fd6.tar.gz
tor-21121eb23103b74692607d7001ad53e871811fd6.zip
Merge branch 'tor-gitlab/mr/652'
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/osinfo/libc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/osinfo/libc.c b/src/lib/osinfo/libc.c
index f52dea41aa..1ca26ff707 100644
--- a/src/lib/osinfo/libc.c
+++ b/src/lib/osinfo/libc.c
@@ -31,6 +31,9 @@
const char *
tor_libc_get_name(void)
{
+#if defined(__BSD_VISIBLE) || defined(__NETBSD_SOURCE)
+ return "BSD";
+#endif /* defined(__BSD_VISIBLE) || defined(__NETBSD_SOURCE) */
#ifdef __GLIBC__
return "Glibc";
#else /* !defined(__GLIBC__) */
@@ -43,6 +46,21 @@ tor_libc_get_name(void)
const char *
tor_libc_get_version_str(void)
{
+#if defined(__BSD_VISIBLE) || defined(__NETBSD_SOURCE)
+#include <sys/param.h>
+#ifdef __DragonFly_version
+ return STR(__DragonFly_version);
+#endif
+#ifdef __FreeBSD__
+ return STR(__FreeBSD_version);
+#endif
+#ifdef __NetBSD_Version__
+ return STR(__NetBSD_Version__);
+#endif
+#ifdef OpenBSD
+ return STR(OpenBSD);
+#endif
+#endif /* defined(__BSD_VISIBLE) || defined(__NETBSD_SOURCE) */
#ifdef CHECK_LIBC_VERSION
const char *version = gnu_get_libc_version();
if (version == NULL)