diff --git a/api/go1.99999.txt b/api/go1.99999.txt index dd6ab70a2079fd..e38944bc6d65f7 100644 --- a/api/go1.99999.txt +++ b/api/go1.99999.txt @@ -9,3 +9,4 @@ pkg net, type SockTrace struct, DidWrite func(int) #58 pkg net, type SockTrace struct, WillCloseTCPConn func(syscall.RawConn) #58 pkg net, type SockTrace struct, WillOverwrite func(*SockTrace) #58 pkg net/http, func SetRoundTripEnforcer(func(*Request) error) #55 +pkg runtime, func TailscaleCurrentP() int #109 diff --git a/src/runtime/tailscale_runtime.go b/src/runtime/tailscale_runtime.go new file mode 100644 index 00000000000000..fca1139fadb485 --- /dev/null +++ b/src/runtime/tailscale_runtime.go @@ -0,0 +1,8 @@ +package runtime + +// TailscaleCurrentP returns the runtime's currently executing 'p' ID. +// +// See https://github.com/tailscale/go/issues/109. +func TailscaleCurrentP() int { + return int(getg().m.p.ptr().id) +}