1*2514Sdlw /* 2*2514Sdlw char id_fstat[] = "@(#)fstat_.c 1.1"; 3*2514Sdlw * 4*2514Sdlw * get file status 5*2514Sdlw * 6*2514Sdlw * calling sequence: 7*2514Sdlw * integer fstat, statb(11) 8*2514Sdlw * call fstat (name, statb) 9*2514Sdlw * where: 10*2514Sdlw * 'statb' will receive the stat structure for file 'name'. 11*2514Sdlw */ 12*2514Sdlw 13*2514Sdlw #include <sys/types.h> 14*2514Sdlw #include <sys/stat.h> 15*2514Sdlw #include "../libI77/f_errno.h" 16*2514Sdlw #include "../libI77/fiodefs.h" 17*2514Sdlw 18*2514Sdlw extern unit units[]; 19*2514Sdlw 20*2514Sdlw long fstat_(lunit, stbuf) 21*2514Sdlw long *lunit, *stbuf; 22*2514Sdlw { 23*2514Sdlw struct stat statb; 24*2514Sdlw 25*2514Sdlw if (*lunit < 0 || *lunit >= MXUNIT) 26*2514Sdlw return((long)(errno=F_ERARG)); 27*2514Sdlw if (!units[*lunit].ufd) 28*2514Sdlw return((long)(errno=F_ERNOPEN)); 29*2514Sdlw if (fstat(fileno(units[*lunit].ufd), &statb) == 0) 30*2514Sdlw { 31*2514Sdlw *stbuf++ = statb.st_dev; 32*2514Sdlw *stbuf++ = statb.st_ino; 33*2514Sdlw *stbuf++ = statb.st_mode; 34*2514Sdlw *stbuf++ = statb.st_nlink; 35*2514Sdlw *stbuf++ = statb.st_uid; 36*2514Sdlw *stbuf++ = statb.st_gid; 37*2514Sdlw *stbuf++ = statb.st_rdev; 38*2514Sdlw *stbuf++ = statb.st_size; 39*2514Sdlw *stbuf++ = statb.st_atime; 40*2514Sdlw *stbuf++ = statb.st_mtime; 41*2514Sdlw *stbuf++ = statb.st_ctime; 42*2514Sdlw return(0L); 43*2514Sdlw } 44*2514Sdlw return ((long)errno); 45*2514Sdlw } 46