After a quick glance, it seems that you don’t maintain the reading/writing status in the shared memory. That means you have to make a syacall in every read/write call. You could look into the kaze-core for an alternative implementation, which doesn’t require any syscall if possible.
Btw, kaze-core uses a `used` atomic variable, to avoid reading both readPos/writePos in routine - they are not atomic at all.
I spent a month porting Rust's Ariadne diagnostic renderer to C,
with Claude as a pair programming partner. The project taught me
a lot about working with LLMs on real system programming tasks -
what works, what doesn't, and where human expertise still matters.
Btw, kaze-core uses a `used` atomic variable, to avoid reading both readPos/writePos in routine - they are not atomic at all.