summaryrefslogtreecommitdiff
path: root/vendor/modernc.org/libc/libc_unix.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2025-02-14 16:54:10 +0000
committerLibravatar GitHub <noreply@github.com>2025-02-14 16:54:10 +0000
commitebbdeee0bb91d5008a405e43114f1653ecdf8ce8 (patch)
treed9b1c087a34e6f5947d553f7cb04503b3c411e93 /vendor/modernc.org/libc/libc_unix.go
parent[bugfix] Drop status indices AFTER updating visibility (#3795) (diff)
downloadgotosocial-ebbdeee0bb91d5008a405e43114f1653ecdf8ce8.tar.xz
bump modernc.org/sqlite to v1.35.0-concurrency-workaround (#3797)
Diffstat (limited to 'vendor/modernc.org/libc/libc_unix.go')
-rw-r--r--vendor/modernc.org/libc/libc_unix.go23
1 files changed, 13 insertions, 10 deletions
diff --git a/vendor/modernc.org/libc/libc_unix.go b/vendor/modernc.org/libc/libc_unix.go
index 3521442ff..1d9f1b12b 100644
--- a/vendor/modernc.org/libc/libc_unix.go
+++ b/vendor/modernc.org/libc/libc_unix.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build unix && !(linux && (amd64 || arm64 || loong64))
+//go:build unix && !(linux && (amd64 || arm64 || loong64 || ppc64le || s390x || riscv64 || 386 || arm))
package libc // import "modernc.org/libc"
@@ -18,7 +18,6 @@ import (
"strconv"
"strings"
"sync"
- "syscall"
"time"
"unsafe"
@@ -56,21 +55,21 @@ func Xsignal(t *TLS, signum int32, handler uintptr) uintptr { //TODO use sigacti
signals[signum] = handler
switch handler {
case signal.SIG_DFL:
- panic(todo("%v %#x", syscall.Signal(signum), handler))
+ panic(todo("%v %#x", unix.Signal(signum), handler))
case signal.SIG_IGN:
switch r {
case signal.SIG_DFL:
- gosignal.Ignore(syscall.Signal(signum)) //TODO
+ gosignal.Ignore(unix.Signal(signum)) //TODO
case signal.SIG_IGN:
- gosignal.Ignore(syscall.Signal(signum))
+ gosignal.Ignore(unix.Signal(signum))
default:
- panic(todo("%v %#x", syscall.Signal(signum), handler))
+ panic(todo("%v %#x", unix.Signal(signum), handler))
}
default:
switch r {
case signal.SIG_DFL:
c := make(chan os.Signal, 1)
- gosignal.Notify(c, syscall.Signal(signum))
+ gosignal.Notify(c, unix.Signal(signum))
go func() { //TODO mechanism to stop/cancel
for {
<-c
@@ -82,9 +81,9 @@ func Xsignal(t *TLS, signum int32, handler uintptr) uintptr { //TODO use sigacti
}
}()
case signal.SIG_IGN:
- panic(todo("%v %#x", syscall.Signal(signum), handler))
+ panic(todo("%v %#x", unix.Signal(signum), handler))
default:
- panic(todo("%v %#x", syscall.Signal(signum), handler))
+ panic(todo("%v %#x", unix.Signal(signum), handler))
}
}
return r
@@ -140,7 +139,11 @@ func Xremove(t *TLS, pathname uintptr) int32 {
if __ccgo_strace {
trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2))
}
- panic(todo(""))
+ if err := os.Remove(GoString(pathname)); err != nil {
+ t.setErrno(err)
+ return -1
+ }
+ return 0
}
// long pathconf(const char *path, int name);