#include "stdio_impl.h"
#include <errno.h>
#include <string.h>
+#include <stdlib.h>
#include <inttypes.h>
+#include "libc.h"
struct cookie {
size_t pos, len, size;
if (!plus) f->f.flags = (*mode == 'r') ? F_NOWR : F_NORD;
if (*mode == 'r') f->c.len = size;
else if (*mode == 'a') f->c.len = f->c.pos = strnlen(buf, size);
+ else if (plus) *f->c.buf = 0;
f->f.read = mread;
f->f.write = mwrite;