2021-11-29 07:07:20 +00:00
|
|
|
From 23f7ad8b28284017c4f63e944bcb0321eb205e8a Mon Sep 17 00:00:00 2001
|
2021-04-20 06:12:42 +00:00
|
|
|
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
|
|
|
|
Date: Mon, 19 Apr 2021 07:21:41 +0200
|
|
|
|
Subject: [PATCH] Use generic errstr.go implementation on musl
|
|
|
|
|
|
|
|
glibc provides two version of strerror_r() depending on a feature test
|
|
|
|
macro. The first is the XSI-compliant version which returns an int, the
|
|
|
|
second is GNU-specific and returns a char pointer.
|
|
|
|
|
|
|
|
Similarity, gcc's libgo provides two implementations of Errstr() both of
|
|
|
|
which use strerror_r(). On Linux, it is assumed that the GNU-specific
|
|
|
|
strerror_r version is used. However, musl only provides the
|
|
|
|
XSI-compliant version of strerror_r. This patch enables the generic
|
|
|
|
Errstr() implementation which also uses the XSI-compliant version of
|
|
|
|
strerror_r.
|
|
|
|
---
|
|
|
|
libgo/go/syscall/errstr.go | 1 -
|
|
|
|
libgo/go/syscall/errstr_glibc.go | 2 +-
|
|
|
|
2 files changed, 1 insertion(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/libgo/go/syscall/errstr.go b/libgo/go/syscall/errstr.go
|
|
|
|
index 6c2441d364d..8f7c5538163 100644
|
|
|
|
--- a/libgo/go/syscall/errstr.go
|
|
|
|
+++ b/libgo/go/syscall/errstr.go
|
|
|
|
@@ -5,7 +5,6 @@
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
// +build !hurd
|
|
|
|
-// +build !linux
|
|
|
|
|
|
|
|
package syscall
|
|
|
|
|
|
|
|
diff --git a/libgo/go/syscall/errstr_glibc.go b/libgo/go/syscall/errstr_glibc.go
|
|
|
|
index 5b19e6f202d..8dc60172186 100644
|
|
|
|
--- a/libgo/go/syscall/errstr_glibc.go
|
|
|
|
+++ b/libgo/go/syscall/errstr_glibc.go
|
|
|
|
@@ -7,7 +7,7 @@
|
|
|
|
// We use this rather than errstr.go because on GNU/Linux sterror_r
|
|
|
|
// returns a pointer to the error message, and may not use buf at all.
|
|
|
|
|
|
|
|
-// +build hurd linux
|
|
|
|
+// +build hurd !linux
|
|
|
|
|
|
|
|
package syscall
|
|
|
|
|
2021-04-25 11:08:48 +00:00
|
|
|
--
|
2021-11-29 07:07:20 +00:00
|
|
|
2.34.0
|
2021-04-25 11:08:48 +00:00
|
|
|
|