some std wrappers around libc

This commit is contained in:
2025-08-03 10:37:18 +02:00
parent 6fc80626dc
commit 3fd62c6083
8 changed files with 101 additions and 56 deletions

View File

@@ -1,12 +1,12 @@
func main[] : I64
let s: I64 = net.listen(8000)
let resp: String = c.malloc(60000)
let resp: String = mem.alloc(60000)
while true
let c: I64 = c.accept(s, 0, 0)
if c < 0
let conn: I64 = c.accept(s, 0, 0)
if conn < 0
continue
let n: I64 = c.read(c, resp, 60000)
c.send(c, resp, n, 0)
c.close(c)
let n: I64 = c.read(conn, resp, 60000)
c.send(conn, resp, n, 0)
c.close(conn)