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