#include <sys/types.h>
#include <sys/stat.h>

struct filetabfmt {
    unsigned long filesize;
    unsigned long inode;
    unsigned long filemode;
    unsigned long devnumber;
   };

long s_getstat (filenam, filetab)
char *filenam;
struct filetabfmt *filetab;
{
   struct stat buf;
   int res;

   res = stat (filenam, &buf);
   if (res == 0)
      {filetab->filesize = buf.st_size;
       filetab->inode = buf.st_ino;
       filetab->filemode = buf.st_mode;
       filetab->devnumber = buf.st_dev;
      }
   return res;
}

long s_getfstat (fildes, filetab)
int fildes;
struct filetabfmt *filetab;
{
   struct stat buf;
   int res;

   res = fstat (fildes, &buf);
   if (res == 0)
      {filetab->filesize = buf.st_size;
       filetab->inode = buf.st_ino;
       filetab->filemode = buf.st_mode;
       filetab->devnumber = buf.st_dev;
      }
   return res;
}
