github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/runtime/runtime_tinygowasm_unknown.go (about) 1 //go:build wasm_unknown 2 3 package runtime 4 5 const ( 6 stdout = 1 7 ) 8 9 func putchar(c byte) { 10 } 11 12 func getchar() byte { 13 // dummy, TODO 14 return 0 15 } 16 17 func buffered() int { 18 // dummy, TODO 19 return 0 20 } 21 22 //go:linkname now time.now 23 func now() (sec int64, nsec int32, mono int64) { 24 return 0, 0, 0 25 } 26 27 // Abort executes the wasm 'unreachable' instruction. 28 func abort() { 29 trap() 30 } 31 32 //go:linkname syscall_Exit syscall.Exit 33 func syscall_Exit(code int) { 34 } 35 36 // There is not yet any support for any form of parallelism on WebAssembly, so these 37 // can be left empty. 38 39 //go:linkname procPin sync/atomic.runtime_procPin 40 func procPin() { 41 } 42 43 //go:linkname procUnpin sync/atomic.runtime_procUnpin 44 func procUnpin() { 45 } 46 47 func hardwareRand() (n uint64, ok bool) { 48 return 0, false 49 }