...
Run Format

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  // +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  )
    23  
    24  // It's hard to tease out exactly how big a Sigset is, but
    25  // rt_sigprocmask crashes if we get it wrong, so if binaries
    26  // are running, this is right.
    27  type sigset [2]uint32
    28  
    29  var sigset_all = sigset{^uint32(0), ^uint32(0)}
    30  
    31  //go:nosplit
    32  //go:nowritebarrierrec
    33  func sigaddset(mask *sigset, i int) {
    34  	(*mask)[(i-1)/32] |= 1 << ((uint32(i) - 1) & 31)
    35  }
    36  
    37  func sigdelset(mask *sigset, i int) {
    38  	(*mask)[(i-1)/32] &^= 1 << ((uint32(i) - 1) & 31)
    39  }
    40  
    41  func sigfillset(mask *uint64) {
    42  	*mask = ^uint64(0)
    43  }
    44  

View as plain text