Esempio n. 1
0
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);
}
Esempio n. 2
0
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);
}
Esempio n. 3
0
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);
}
Esempio n. 4
0
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);
}
Esempio n. 5
0
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);
}
Esempio n. 6
0
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);
}
Esempio n. 7
0
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(&current->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;
}