mirror of
https://github.com/sliverarmory/reflektor
synced 2026-08-25 09:14:48 +00:00
20 lines
566 B
Go
20 lines
566 B
Go
//go:build linux
|
|
|
|
package main
|
|
|
|
import "os/user"
|
|
|
|
func exercisePlatformRuntime() {
|
|
// The cgo implementation reaches glibc's NSS path. On RISC-V that path
|
|
// calls STT_GNU_IFUNC symbols such as memcpy, so this also verifies that a
|
|
// manually mapped Go c-shared image invokes the resolved implementation
|
|
// rather than the IFUNC resolver.
|
|
current, err := user.Current()
|
|
if err != nil {
|
|
panic("os/user.Current: " + err.Error())
|
|
}
|
|
if current == nil || current.Uid == "" || current.Username == "" {
|
|
panic("os/user.Current returned an incomplete user")
|
|
}
|
|
}
|