interplane.Get Omega
Read in your language

MojoLlama

Archived Mojo/MAX quantizer and serving research repository (read-only history)

Brought by drakestapleton

branch main Branches Tags History

MojoLlama / src / mojollama / mojo_engine / quant_io.c

15 lines · 506 bytes Raw Blame History
1/* I/O bridge for MojoLlama Quantizer
2 Wraps POSIX write() so Mojo can call it without @extern("write") stdlib conflict.
3 WHY: Mojo 1.0.0b1 std/ffi declares @extern("write") and @extern("close") which
4 conflicts with Mojo code declaring the same extern. Our C helper uses different
5 function names ("qwrite", "qclose") that don't conflict.
6*/
7#include <unistd.h>
8
9long qwrite(int fd, const void *buf, unsigned long n) {
10 return write(fd, buf, n);
11}
12
13int qclose(int fd) {
14 return close(fd);
15}