github.com/m10x/go/src@v0.0.0-20220112094212-ba61592315da/runtime/stubs2.go (about)

     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  //go:build !aix && !darwin && !js && !openbsd && !plan9 && !solaris && !windows
     6  
     7  package runtime
     8  
     9  import "unsafe"
    10  
    11  // read calls the read system call.
    12  // It returns a non-negative number of bytes written or a negative errno value.
    13  func read(fd int32, p unsafe.Pointer, n int32) int32
    14  
    15  func closefd(fd int32) int32
    16  
    17  func exit(code int32)
    18  func usleep(usec uint32)
    19  
    20  //go:nosplit
    21  func usleep_no_g(usec uint32) {
    22  	usleep(usec)
    23  }
    24  
    25  // write calls the write system call.
    26  // It returns a non-negative number of bytes written or a negative errno value.
    27  //go:noescape
    28  func write1(fd uintptr, p unsafe.Pointer, n int32) int32
    29  
    30  //go:noescape
    31  func open(name *byte, mode, perm int32) int32
    32  
    33  // return value is only set on linux to be used in osinit()
    34  func madvise(addr unsafe.Pointer, n uintptr, flags int32) int32
    35  
    36  // exitThread terminates the current thread, writing *wait = 0 when
    37  // the stack is safe to reclaim.
    38  //
    39  //go:noescape
    40  func exitThread(wait *uint32)