| 1 |
// SPDX-License-Identifier: Apache-2.0 |
| 2 |
// SPDX-FileCopyrightText: 2022 The Ebitengine Authors |
| 3 |
|
| 4 |
//go:build !cgo && (darwin || freebsd || linux || netbsd) |
| 5 |
|
| 6 |
package fakecgo |
| 7 |
|
| 8 |
import "structs" |
| 9 |
|
| 10 |
type ( |
| 11 |
size_t uintptr |
| 12 |
// Sources: |
| 13 |
// Darwin (32 bytes) - https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/sys/_types.h#L74 |
| 14 |
// FreeBSD (32 bytes) - https://github.com/DoctorWkt/xv6-freebsd/blob/d2a294c2a984baed27676068b15ed9a29b06ab6f/include/signal.h#L98C9-L98C21 |
| 15 |
// Linux (128 bytes) - https://github.com/torvalds/linux/blob/ab75170520d4964f3acf8bb1f91d34cbc650688e/arch/x86/include/asm/signal.h#L25 |
| 16 |
sigset_t [128]byte |
| 17 |
pthread_attr_t [64]byte |
| 18 |
pthread_t int |
| 19 |
pthread_key_t uint64 |
| 20 |
) |
| 21 |
|
| 22 |
// for pthread_sigmask: |
| 23 |
|
| 24 |
type sighow int32 |
| 25 |
|
| 26 |
const ( |
| 27 |
SIG_BLOCK sighow = 0 |
| 28 |
SIG_UNBLOCK sighow = 1 |
| 29 |
SIG_SETMASK sighow = 2 |
| 30 |
) |
| 31 |
|
| 32 |
type G struct { |
| 33 |
_ structs.HostLayout |
| 34 |
stacklo uintptr |
| 35 |
stackhi uintptr |
| 36 |
} |
| 37 |
|
| 38 |
type ThreadStart struct { |
| 39 |
_ structs.HostLayout |
| 40 |
g *G |
| 41 |
tls *uintptr |
| 42 |
fn uintptr |
| 43 |
} |