Something went wrong. Try again.
🌱 A minimal programming language and compiler. git.urbach.dev/cli/q
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849openRead(path *byte) -> (!uint, error) { fd := syscall(_openat, -100, path, readOnly, 0)
if fd < 0 { return 0, fd }
return fd, 0}
openWrite(path *byte) -> (!uint, error) { fd := syscall(_openat, -100, path, writeOnly | create | truncate, 0o644)
if fd < 0 { return 0, fd }
return fd, 0}
size(fd uint) -> (uint, error) { stats := new(FileStat) err := syscall(_fstat, fd, stats)
if err != 0 { return 0, err }
size := stats.size as uint return size, 0}
close(fd !uint) -> error { return syscall(_close, fd)}
memfd_create(path *byte, flags uint) -> (!uint, error) { fd := syscall(_memfd_create, path, flags)
if fd < 0 { return 0, fd }
return fd, 0}
ftruncate(fd uint, length uint) -> error { return syscall(_ftruncate, fd, length)}