Open jpittis opened 4 years ago
Note that I've been working on some uring things for the zig std lib. https://github.com/ziglang/zig/pull/3083 is the only published artifact at the moment. At some point in the current release cycle I will revisit it.
Currently const c = @cImport(@cInclude("liburing.h"));
works but with warning on atomics, function like io_uring_buf_ring_advance
are demoted to pub extern fn
but in the c code they are static inline
error when calling io_uring_buf_ring_advance
in zig: _error: ld.lld: undefined symbol: io_uring_buf_ringadvance
__io_uring_peek_cqe
also causes an // /usr/include/liburing.h:1245:19: warning: unable to translate function, demoted to extern
.
It uses io_uring_smp_load_acquire
, which uses __typeof__
, which fails.
pub const io_uring_smp_load_acquire = @compileError("unable to translate macro: undefined identifier `__typeof__`"); // /usr/include/liburing/barrier.h:73:9
#define io_uring_smp_load_acquire(p) \
atomic_load_explicit((_Atomic __typeof__(*(p)) *)(p), \
memory_order_acquire)`
__typeof__
is a compiler extension.
Edit: typeof is now a c23 standard: https://learn.microsoft.com/de-de/cpp/c-language/typeof-c?view=msvc-170
Ran into some "unable to translate function" errors when trying to use liburing:
To reproduce, you can add these to your build file:
Import liburing:
And try to call
liburing.io_uring_wait_cqe
and orliburing.io_uring_cqe_seen
.A minimal example would likely be something along the lines of:
Hope this is helpful.