Artifact 45cb80b779db32a5b540ac2216b1692c95f71f083053a3a37080184d4c9818cf:
- File mod/kstr/bufflush.fn.c — part of check-in [8d6b36fcac] at 2019-10-30 07:44:12 on branch trunk — factor out write buffer code so any module and libk users can call it; update documentation to match; add kssz string length function (user: lexi, size: 201) [annotate] [blame] [check-ins using]
#include <k/type.h>
#include <k/str.h>
#include <k/io.h>
kiocond
ksbufflush(ksbuf* b) {
ksraw str = {b -> cur - b -> buf, b -> buf};
b -> cur = b -> buf;
return kiosend(b -> channel, str, null);
}