2016-09-29 00:56:44 +00:00
|
|
|
// Copyright 2014 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.
|
|
|
|
|
2022-02-16 11:30:04 -08:00
|
|
|
//go:build !js && !plan9 && !windows
|
2016-09-29 00:56:44 +00:00
|
|
|
|
|
|
|
package runtime
|
|
|
|
|
|
|
|
import "unsafe"
|
|
|
|
|
2020-01-02 15:05:27 -08:00
|
|
|
// read calls the read system call.
|
|
|
|
// It returns a non-negative number of bytes written or a negative errno value.
|
2018-01-19 04:48:51 +00:00
|
|
|
//go:noescape
|
2016-09-29 00:56:44 +00:00
|
|
|
func read(fd int32, p unsafe.Pointer, n int32) int32
|
2020-01-02 15:05:27 -08:00
|
|
|
|
2016-09-29 00:56:44 +00:00
|
|
|
func closefd(fd int32) int32
|
|
|
|
|
2020-10-26 18:42:08 +00:00
|
|
|
//extern-sysinfo exit
|
2016-09-29 00:56:44 +00:00
|
|
|
func exit(code int32)
|
|
|
|
func usleep(usec uint32)
|
|
|
|
|
2021-07-30 14:28:58 -07:00
|
|
|
//go:nosplit
|
|
|
|
func usleep_no_g(usec uint32) {
|
|
|
|
usleep(usec)
|
|
|
|
}
|
|
|
|
|
2020-01-02 15:05:27 -08:00
|
|
|
// write calls the write system call.
|
|
|
|
// It returns a non-negative number of bytes written or a negative errno value.
|
2016-09-29 00:56:44 +00:00
|
|
|
//go:noescape
|
2020-01-02 15:05:27 -08:00
|
|
|
func write1(fd uintptr, p unsafe.Pointer, n int32) int32
|
2016-09-29 00:56:44 +00:00
|
|
|
|
|
|
|
//go:noescape
|
|
|
|
func open(name *byte, mode, perm int32) int32
|
2018-01-09 01:23:08 +00:00
|
|
|
|
|
|
|
// exitThread terminates the current thread, writing *wait = 0 when
|
|
|
|
// the stack is safe to reclaim.
|
|
|
|
func exitThread(wait *uint32) {
|
|
|
|
// This is never used by gccgo.
|
|
|
|
throw("exitThread")
|
|
|
|
}
|
2019-08-28 20:39:32 +00:00
|
|
|
|
|
|
|
// So that the C initialization code can call osinit.
|
|
|
|
//go:linkname osinit runtime.osinit
|