summaryrefslogtreecommitdiff
path: root/vendor/modernc.org/libc/etc.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/modernc.org/libc/etc.go')
-rw-r--r--vendor/modernc.org/libc/etc.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/vendor/modernc.org/libc/etc.go b/vendor/modernc.org/libc/etc.go
index c8a64bd7c..adbe7590f 100644
--- a/vendor/modernc.org/libc/etc.go
+++ b/vendor/modernc.org/libc/etc.go
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !(linux && (amd64 || loong64))
+
package libc // import "modernc.org/libc"
import (
@@ -170,6 +172,10 @@ func removeObject(t uintptr) {
}
func (t *TLS) setErrno(err interface{}) {
+ if t == nil {
+ panic("nil TLS")
+ }
+
if memgrind {
if atomic.SwapInt32(&t.reentryGuard, 1) != 0 {
panic(todo("concurrent use of TLS instance %p", t))
@@ -566,6 +572,19 @@ func VaUintptr(app *uintptr) uintptr {
return v
}
+func getVaList(va uintptr) []string {
+ r := []string{}
+
+ for p := va; ; p += 8 {
+ st := *(*uintptr)(unsafe.Pointer(p))
+ if st == 0 {
+ return r
+ }
+ r = append(r, GoString(st))
+ }
+ return r
+}
+
func roundup(n, to uintptr) uintptr {
if r := n % to; r != 0 {
return n + to - r