From b5c2bd7e050ceb00b1f240d8759e1ed9ebcfa4c7 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 2 Mar 2026 09:40:12 -0800 Subject: syscall: define no-op Errno type on plan9 Go's api/go1.txt's has line "pkg syscall, type Errno uintptr", suggesting people should assume this type always exists. It does for GOOS=js GOARCH=wasm too, which was also added later. Adding this here lets portable code be written without build-tagged files, using runtime.GOOS checks instead. Change-Id: I785a19ec104d2ac34b55a96b5a342bcc33712961 Reviewed-on: https://go-review.googlesource.com/c/go/+/750680 LUCI-TryBot-Result: Go LUCI Reviewed-by: Ian Lance Taylor Reviewed-by: Damien Neil Reviewed-by: David Chase --- src/syscall/syscall_plan9.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/syscall') diff --git a/src/syscall/syscall_plan9.go b/src/syscall/syscall_plan9.go index 968782008d..7a130907dd 100644 --- a/src/syscall/syscall_plan9.go +++ b/src/syscall/syscall_plan9.go @@ -21,6 +21,15 @@ import ( const ImplementsGetwd = true const bitSize16 = 2 +// Errno is not used with GOOS plan9. +// +// It exists because because the Go 1 API contract +// (api/go1.txt's "pkg syscall, type Errno uintptr") +// says it exists, and so code in the ecosystem often +// assume it exists. This lets portable code be written +// without build-tagged files, using runtime.GOOS checks instead. +type Errno uintptr + // ErrorString implements Error's String method by returning itself. // // ErrorString values can be tested against error values using [errors.Is]. -- cgit v1.3-6-g1900