shithub: riscv

ref: 855cf4326f5a07d7142c2d8918f5fa856d912b85
dir: /sys/src/ape/lib/ap/plan9/stat.c/

View raw version
#include "lib.h"
#include <sys/stat.h>
#include <errno.h>
#include <stdlib.h>
#include "sys9.h"
#include "dir.h"

int
stat(const char *path, struct stat *buf)
{
	Dir *d;

	if((d = _dirstat(path)) == nil){
		_syserrno();
		return -1;
	}
	_dirtostat(buf, d, 0);
	free(d);

	return 0;
}