scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

 1#include <sys/stat.h>
 2
 3#include <limits.h>
 4#include <time.h>
 5
 6#include <scc/scc.h>
 7
 8int
 9getstat(char *fname, struct fprop *prop)
10{
11	struct stat st;
12
13	if (stat(fname, &st) < 0)
14		return -1;
15	if (st.st_size > LONG_MAX)
16		return -1;
17	prop->uid = st.st_uid;
18	prop->gid = st.st_gid;
19	prop->mode = st.st_mode;
20	prop->time = st.st_mtime;
21	prop->size = st.st_size;
22
23	return 0;
24}