Black Lives Matter. Support the Equal Justice Initiative.

Source file src/runtime/os_linux_generic.go

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

View as plain text