#include #include size_t ring_to_virt(ring_t *r, Proc *proc, void __user *ubuf, size_t max) { char tmp[32]; if (max > sizeof tmp) max = sizeof tmp; max = ring_get(r, tmp, max); return pcpy_to(proc, ubuf, tmp, max); }