Source file src/runtime/stubs2.go

     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  //
    28  //go:noescape
    29  func write1(fd uintptr, p unsafe.Pointer, n int32) int32
    30  
    31  //go:noescape
    32  func open(name *byte, mode, perm int32) int32
    33  
    34  // return value is only set on linux to be used in osinit()
    35  func madvise(addr unsafe.Pointer, n uintptr, flags int32) int32
    36  
    37  // exitThread terminates the current thread, writing *wait = 0 when
    38  // the stack is safe to reclaim.
    39  //
    40  //go:noescape
    41  func exitThread(wait *uint32)
    42  

View as plain text