Pristine Ack-5.5
[Ack-5.5.git] / modules / src / system / filesize.c
1 /*
2  * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3  * See the copyright notice in the ACK home directory, in the file "Copyright".
4  */
5 /* $Id: filesize.c,v 1.4 1994/06/24 11:24:24 ceriel Exp $ */
6
7 #include <sys/types.h>
8 #include <sys/stat.h>
9 #include <system.h>
10
11 long
12 sys_filesize(path)
13         char *path;
14 {
15         struct stat st_buf;
16
17         if (stat(path, &st_buf) != 0)
18                 return -1L;
19         return (long) st_buf.st_size;
20 }