1// Copyright 2014 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 !plan9
6// +build !windows
7// +build !js
8
9package runtime
10
11import "unsafe"
12
13// read calls the read system call.
14// It returns a non-negative number of bytes written or a negative errno value.
15//go:noescape
16func read(fd int32, p unsafe.Pointer, n int32) int32
17
18func closefd(fd int32) int32
19
20//extern exit
21func exit(code int32)
22func usleep(usec uint32)
23
24// write calls the write system call.
25// It returns a non-negative number of bytes written or a negative errno value.
26//go:noescape
27func write1(fd uintptr, p unsafe.Pointer, n int32) int32
28
29//go:noescape
30func open(name *byte, mode, perm int32) int32
31
32// exitThread terminates the current thread, writing *wait = 0 when
33// the stack is safe to reclaim.
34func exitThread(wait *uint32) {
35	// This is never used by gccgo.
36	throw("exitThread")
37}
38
39// So that the C initialization code can call osinit.
40//go:linkname osinit runtime.osinit
41