Home | History | Annotate | Download | only in runtime
      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 // +build !mips
      6 // +build !mipsle
      7 // +build !mips64
      8 // +build !mips64le
      9 // +build !s390x
     10 // +build !ppc64
     11 // +build linux
     12 
     13 package runtime
     14 
     15 const (
     16 	_SS_DISABLE  = 2
     17 	_NSIG        = 65
     18 	_SI_USER     = 0
     19 	_SIG_BLOCK   = 0
     20 	_SIG_UNBLOCK = 1
     21 	_SIG_SETMASK = 2
     22 	_RLIMIT_AS   = 9
     23 )
     24 
     25 // It's hard to tease out exactly how big a Sigset is, but
     26 // rt_sigprocmask crashes if we get it wrong, so if binaries
     27 // are running, this is right.
     28 type sigset [2]uint32
     29 
     30 type rlimit struct {
     31 	rlim_cur uintptr
     32 	rlim_max uintptr
     33 }
     34 
     35 var sigset_all = sigset{^uint32(0), ^uint32(0)}
     36 
     37 //go:nosplit
     38 //go:nowritebarrierrec
     39 func sigaddset(mask *sigset, i int) {
     40 	(*mask)[(i-1)/32] |= 1 << ((uint32(i) - 1) & 31)
     41 }
     42 
     43 func sigdelset(mask *sigset, i int) {
     44 	(*mask)[(i-1)/32] &^= 1 << ((uint32(i) - 1) & 31)
     45 }
     46 
     47 func sigfillset(mask *uint64) {
     48 	*mask = ^uint64(0)
     49 }
     50