github.com/AESNooper/go/src@v0.0.0-20220218095104-b56a4ab1bbbb/runtime/os_openbsd_syscall2.go (about) 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 //go:build openbsd && mips64 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 //go:nosplit 36 func usleep_no_g(usec uint32) { 37 usleep(usec) 38 } 39 40 // write calls the write system call. 41 // It returns a non-negative number of bytes written or a negative errno value. 42 //go:noescape 43 func write1(fd uintptr, p unsafe.Pointer, n int32) int32 44 45 //go:noescape 46 func open(name *byte, mode, perm int32) int32 47 48 // return value is only set on linux to be used in osinit() 49 func madvise(addr unsafe.Pointer, n uintptr, flags int32) int32 50 51 // exitThread terminates the current thread, writing *wait = 0 when 52 // the stack is safe to reclaim. 53 // 54 //go:noescape 55 func exitThread(wait *uint32) 56 57 //go:noescape 58 func obsdsigprocmask(how int32, new sigset) sigset 59 60 //go:nosplit 61 //go:nowritebarrierrec 62 func sigprocmask(how int32, new, old *sigset) { 63 n := sigset(0) 64 if new != nil { 65 n = *new 66 } 67 r := obsdsigprocmask(how, n) 68 if old != nil { 69 *old = r 70 } 71 } 72 73 func pipe() (r, w int32, errno int32) 74 func pipe2(flags int32) (r, w int32, errno int32) 75 76 //go:noescape 77 func setitimer(mode int32, new, old *itimerval) 78 79 //go:noescape 80 func sysctl(mib *uint32, miblen uint32, out *byte, size *uintptr, dst *byte, ndst uintptr) int32 81 82 // mmap calls the mmap system call. It is implemented in assembly. 83 // We only pass the lower 32 bits of file offset to the 84 // assembly routine; the higher bits (if required), should be provided 85 // by the assembly routine as 0. 86 // The err result is an OS error code such as ENOMEM. 87 func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uint32) (p unsafe.Pointer, err int) 88 89 // munmap calls the munmap system call. It is implemented in assembly. 90 func munmap(addr unsafe.Pointer, n uintptr) 91 92 func nanotime1() int64 93 94 //go:noescape 95 func sigaltstack(new, old *stackt) 96 97 func closeonexec(fd int32) 98 func setNonblock(fd int32) 99 100 func walltime() (sec int64, nsec int32)