stat (path, stbuf)
char *path;
struct stat *stbuf;
fstat(fildes, stbuf)
FD fildes;
struct stat *stbuf;
Similarly, fstat obtains information about an open file known by the file descriptor fildes, obtained from a successful open, or create system call.
stbuf is a pointer to a stat structure into which stat and fstat place information about the file. The contents of the structure pointed to by stbuf includes the following:
ushort st_mode; /* file mode */ ino_t st_info; /* inode number */ dev_t st_dev; /* satellite directory number */ short st_nlink; /* maximum size in blocks */ off_t st_size; /* file size in bytes */stat will return no status information if one of more of the following are true:
fstat will fail if fildes is not a valid open satellite file descriptor. [EBADF]