Source File
	siginfo_linux.go
Belonging Package
	internal/syscall/unix
// Copyright 2023 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.package uniximport ()const is64bit = ^uint(0) >> 63 // 0 for 32-bit hosts, 1 for 64-bit ones.// SiginfoChild is a struct filled in by Linux waitid syscall.// In C, siginfo_t contains a union with multiple members;// this struct corresponds to one used when Signo is SIGCHLD.//// NOTE fields are exported to be used by TestSiginfoChildLayout.type SiginfoChild struct {Signo int32siErrnoCode // Two int32 fields, swapped on MIPS._ [is64bit]int32 // Extra padding for 64-bit hosts only.// End of common part. Beginning of signal-specific part.Pid int32Uid uint32Status int32// Pad to 128 bytes._ [128 - (6+is64bit)*4]byte}const (// Possible values for SiginfoChild.Code field._CLD_EXITED int32 = 1_CLD_KILLED = 2_CLD_DUMPED = 3_CLD_TRAPPED = 4_CLD_STOPPED = 5_CLD_CONTINUED = 6// These are the same as in syscall/syscall_linux.go.core = 0x80stopped = 0x7fcontinued = 0xffff)// WaitStatus converts SiginfoChild, as filled in by the waitid syscall,// to syscall.WaitStatus.func ( *SiginfoChild) () ( syscall.WaitStatus) {switch .Code {case _CLD_EXITED:= syscall.WaitStatus(.Status << 8)case _CLD_DUMPED:= syscall.WaitStatus(.Status) | corecase _CLD_KILLED:= syscall.WaitStatus(.Status)case _CLD_TRAPPED, _CLD_STOPPED:= syscall.WaitStatus(.Status<<8) | stoppedcase _CLD_CONTINUED:= continued}return}
|  | The pages are generated with Golds v0.7.6. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |