Debian Codegraph @

cap/oslockluster.go

raw
1 // +build !go1.10
2
3 package cap
4
5 import "syscall"
6
7 // LaunchSupported indicates that is safe to return from a locked OS
8 // Thread and have that OS Thread be terminated by the runtime. The
9 // Launch functionality really needs to rely on the fact that an
10 // excess of runtime.LockOSThread() vs. runtime.UnlockOSThread() calls
11 // in a returning go routine will cause the underlying locked OSThread
12 // to terminate. That feature was added to the Go runtime in version
13 // 1.10.
14 //
15 // See these bugs for the discussion and feature assumed by the code
16 // in this Launch() functionality: [Go bug 20395], [Go bug 20458].
17 //
18 // A value of false for this constant causes the Launch functionality
19 // to fail with an error: cap.ErrNoLaunch. If this value is false you
20 // have two choices with respect to the Launch functionality:
21 //
22 // 1) don't use cap.(*Launcher).Launch()
23 // 2) upgrade your Go toolchain to 1.10+ (ie., do this one).
24 //
25 // [Go bug 20395]: https://github.com/golang/go/issues/20395
26 // [Go bug 20458]: https://github.com/golang/go/issues/20458
27 const LaunchSupported = false
28
29 // validatePA confirms that the pa.Sys entry is not incompatible with
30 // Launch.
31 func validatePA(pa *syscall.ProcAttr, chroot string) (bool, error) {
32 return false, ErrNoLaunch
33 }