Files
llgo/_embdemo/write-esp32/main.go

18 lines
270 B
Go
Raw Normal View History

2025-09-02 20:06:48 +08:00
package main
2025-09-02 22:25:27 +08:00
import (
_ "unsafe"
"github.com/goplus/lib/c"
)
//go:linkname write C.write
func write(fd c.Int, *c.Char, c.SizeT) int
2025-09-02 20:06:48 +08:00
func main() {
buf := c.Malloc(6)
c.Memset(buf, 0, 6)
c.Strncpy((*c.Char)(buf), c.Str("abcde"), 5)
write(1, (*c.Char)(buf), 5)
}