void sysfwstat(Ar0* ar0, ...) { Chan *c; int fd; uint8_t *p; usize n; va_list list; va_start(list, ar0); /* * int fwstat(int fd, uchar* edir, int nedir); * should really be * usize wstat(int fd, uchar* edir, usize nedir); * but returning an unsigned is probably too * radical. */ fd = va_arg(list, int); p = va_arg(list, uint8_t*); n = va_arg(list, usize); p = validaddr(p, n, 0); validstat(p, n); c = fdtochan(fd, -1, 1, 1); va_end(list); ar0->l = wstat(c, p, n); }
void syswstat(Ar0* ar0, ...) { Chan *c; char *aname; uint8_t *p; usize n; va_list list; va_start(list, ar0); /* * int wstat(char* name, uchar* edir, int nedir); * should really be * usize wstat(char* name, uchar* edir, usize nedir); * but returning an unsigned is probably too * radical. */ aname = va_arg(list, char*); p = va_arg(list, uint8_t*); n = va_arg(list, usize); p = validaddr(p, n, 0); validstat(p, n); c = namec(validaddr(aname, 1, 0), Aaccess, 0, 0); va_end(list); ar0->l = wstat(c, p, n); }
long sysfwstat(ulong *arg) { Chan *c; uint l; l = arg[2]; validaddr(arg[1], l, 0); validstat((uchar*)arg[1], l); c = fdtochan(arg[0], -1, 1, 1); return wstat(c, (uchar*)arg[1], l); }
long syswstat(ulong *arg) { Chan *c; uint l; l = arg[2]; validaddr(arg[1], l, 0); validstat((uchar*)arg[1], l); validaddr(arg[0], 1, 0); c = namec((char*)arg[0], Aaccess, 0, 0); return wstat(c, (uchar*)arg[1], l); }
long sysfwstat(uint32 *arg) { Chan *c; uint l; uchar *p; l = arg[2]; p = uvalidaddr(arg[1], l, 0); validstat(p, l); c = fdtochan(arg[0], -1, 1, 1); return wstat(c, p, l); }
long syswstat(uint32 *arg) { Chan *c; uint l; char *name; uchar *p; l = arg[2]; p = uvalidaddr(arg[1], l, 0); validstat(p, l); name = uvalidaddr(arg[0], 1, 0); c = namec(name, Aaccess, 0, 0); return wstat(c, p, l); }
int sysfwstat(int fd, uint8_t * buf, int n) { ERRSTACK(2); struct chan *c; if (waserror()) { poperror(); return -1; } validstat(buf, n, 0); c = fdtochan(¤t->open_files, fd, -1, 1, 1); if (waserror()) { cclose(c); nexterror(); } n = devtab[c->type].wstat(c, buf, n); poperror(); cclose(c); poperror(); return n; }