Ejemplo n.º 1
0
bool TestExtFile::test_fstat() {
  Variant f = f_fopen("test/test_ext_file.tmp", "w");
  f_fputs(f, "testing fstat");
  f_fclose(f);

  f = f_fopen("test/test_ext_file.tmp", "r");
  VS(f_fstat(f)["size"], 13);
  return Count(true);
}
Ejemplo n.º 2
0
int
con_fstat(int fid)
{
	Fcall in, ou;
	Chan *cp;

	in.type = Tstat;
	in.fid = fid;
	cp = cons.chan;

	rlock(&mainlock);
	ou.type = Tstat+1;
	ou.err = 0;

	rlock(&cp->reflock);
	f_fstat(cp, &in, &ou);
	runlock(&cp->reflock);

	runlock(&mainlock);
	return ou.err;
}