github.com/AESNooper/go/src@v0.0.0-20220218095104-b56a4ab1bbbb/runtime/os_linux_generic.go (about) 1 // Copyright 2009 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 !mips && !mipsle && !mips64 && !mips64le && !s390x && !ppc64 && linux 6 7 package runtime 8 9 const ( 10 _SS_DISABLE = 2 11 _NSIG = 65 12 _SI_USER = 0 13 _SIG_BLOCK = 0 14 _SIG_UNBLOCK = 1 15 _SIG_SETMASK = 2 16 ) 17 18 // It's hard to tease out exactly how big a Sigset is, but 19 // rt_sigprocmask crashes if we get it wrong, so if binaries 20 // are running, this is right. 21 type sigset [2]uint32 22 23 var sigset_all = sigset{^uint32(0), ^uint32(0)} 24 25 //go:nosplit 26 //go:nowritebarrierrec 27 func sigaddset(mask *sigset, i int) { 28 (*mask)[(i-1)/32] |= 1 << ((uint32(i) - 1) & 31) 29 } 30 31 func sigdelset(mask *sigset, i int) { 32 (*mask)[(i-1)/32] &^= 1 << ((uint32(i) - 1) & 31) 33 } 34 35 //go:nosplit 36 func sigfillset(mask *uint64) { 37 *mask = ^uint64(0) 38 }