|
| 1 | +// Copyright 2020 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 openbsd,!amd64 |
| 6 | + |
| 7 | +package runtime |
| 8 | + |
| 9 | +import ( |
| 10 | + "unsafe" |
| 11 | +) |
| 12 | + |
| 13 | +//go:noescape |
| 14 | +func sigaction(sig uint32, new, old *sigactiont) |
| 15 | + |
| 16 | +func kqueue() int32 |
| 17 | + |
| 18 | +//go:noescape |
| 19 | +func kevent(kq int32, ch *keventt, nch int32, ev *keventt, nev int32, ts *timespec) int32 |
| 20 | + |
| 21 | +func raiseproc(sig uint32) |
| 22 | + |
| 23 | +func getthrid() int32 |
| 24 | +func thrkill(tid int32, sig int) |
| 25 | + |
| 26 | +// read calls the read system call. |
| 27 | +// It returns a non-negative number of bytes written or a negative errno value. |
| 28 | +func read(fd int32, p unsafe.Pointer, n int32) int32 |
| 29 | + |
| 30 | +func closefd(fd int32) int32 |
| 31 | + |
| 32 | +func exit(code int32) |
| 33 | +func usleep(usec uint32) |
| 34 | + |
| 35 | +// write calls the write system call. |
| 36 | +// It returns a non-negative number of bytes written or a negative errno value. |
| 37 | +//go:noescape |
| 38 | +func write1(fd uintptr, p unsafe.Pointer, n int32) int32 |
| 39 | + |
| 40 | +//go:noescape |
| 41 | +func open(name *byte, mode, perm int32) int32 |
| 42 | + |
| 43 | +// return value is only set on linux to be used in osinit() |
| 44 | +func madvise(addr unsafe.Pointer, n uintptr, flags int32) int32 |
| 45 | + |
| 46 | +// exitThread terminates the current thread, writing *wait = 0 when |
| 47 | +// the stack is safe to reclaim. |
| 48 | +// |
| 49 | +//go:noescape |
| 50 | +func exitThread(wait *uint32) |
| 51 | + |
| 52 | +//go:noescape |
| 53 | +func obsdsigprocmask(how int32, new sigset) sigset |
| 54 | + |
| 55 | +//go:nosplit |
| 56 | +//go:nowritebarrierrec |
| 57 | +func sigprocmask(how int32, new, old *sigset) { |
| 58 | + n := sigset(0) |
| 59 | + if new != nil { |
| 60 | + n = *new |
| 61 | + } |
| 62 | + r := obsdsigprocmask(how, n) |
| 63 | + if old != nil { |
| 64 | + *old = r |
| 65 | + } |
| 66 | +} |
| 67 | + |
| 68 | +func pipe() (r, w int32, errno int32) |
| 69 | +func pipe2(flags int32) (r, w int32, errno int32) |
| 70 | + |
| 71 | +//go:noescape |
| 72 | +func setitimer(mode int32, new, old *itimerval) |
| 73 | + |
| 74 | +//go:noescape |
| 75 | +func sysctl(mib *uint32, miblen uint32, out *byte, size *uintptr, dst *byte, ndst uintptr) int32 |
| 76 | + |
| 77 | +// mmap calls the mmap system call. It is implemented in assembly. |
| 78 | +// We only pass the lower 32 bits of file offset to the |
| 79 | +// assembly routine; the higher bits (if required), should be provided |
| 80 | +// by the assembly routine as 0. |
| 81 | +// The err result is an OS error code such as ENOMEM. |
| 82 | +func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uint32) (p unsafe.Pointer, err int) |
| 83 | + |
| 84 | +// munmap calls the munmap system call. It is implemented in assembly. |
| 85 | +func munmap(addr unsafe.Pointer, n uintptr) |
| 86 | + |
| 87 | +func nanotime1() int64 |
| 88 | + |
| 89 | +//go:noescape |
| 90 | +func sigaltstack(new, old *stackt) |
| 91 | + |
| 92 | +func closeonexec(fd int32) |
| 93 | +func setNonblock(fd int32) |
| 94 | + |
| 95 | +func walltime1() (sec int64, nsec int32) |
0 commit comments