]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MINICERN/packlib/kernlib/kerngen/ccgen/apofsz.c
This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / MINICERN / packlib / kernlib / kerngen / ccgen / apofsz.c
1 /*
2  * Get the file size when using Apogee compiler
3  * on a Sun Solaris box. 
4  */
5 #include <sys/stat.h>
6 #include <stdlib.h>
7
8 int
9 apofsz_(s,nbytes,slen)
10 char *s;
11 int *nbytes;
12 int slen;
13 {
14   int i;
15   char *ss = (char *)malloc(slen + 1);
16   struct stat sbuf;
17   for (i = 0; i < slen; i++) {
18     if (s[i] == ' ') break;
19     else ss[i] = s[i];
20   }
21   ss[i] = '\0';
22   i = stat(ss,&sbuf);
23   free(ss);
24   *nbytes = (int)sbuf.st_size;
25   return i;
26 }