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

View as plain text