static int mput(Map *map, uvlong addr, void *buf, int size) { vlong off; Seg *s; s = reloc(map, addr, &off); if (!s) return -1; if (s->rw == nil) { werrstr("unwritable map"); return -1; } return s->rw(map, s, off, buf, size, 0); }
static int mget(Map *map, uvlong addr, void *buf, int size) { uvlong off; Seg *s; s = reloc(map, addr, (vlong*)&off); if (!s) return -1; if (s->rw == nil) { werrstr("unreadable map"); return -1; } return s->rw(map, s, off, buf, size, 1); }