Debian Codegraph @

src/runtime/security_issetugid.go

raw
1 // Copyright 2023 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 //go:build darwin || dragonfly || freebsd || illumos || netbsd || openbsd || solaris
6
7 package runtime
8
9 // secureMode is only ever mutated in schedinit, so we don't need to worry about
10 // synchronization primitives.
11 var secureMode bool
12
13 func initSecureMode() {
14 secureMode = issetugid() == 1
15 }
16
17 func isSecureMode() bool {
18 return secureMode
19 }