Open System Services System Calls Reference Manual (G06.28+, H06.05+)
fstat(2) OSS System Calls Reference Manual
NAME
fstat - Provides information about an open file
LIBRARY
G-series native OSS processes: system library
H-series OSS processes: implicit libraries
SYNOPSIS
#include <sys/types.h> /* optional except for POSIX.1 */
#include <sys/stat.h>
int fstat(
int filedes,
struct stat *buffer);
PARAMETERS
filedes Specifies an open file descriptor obtained from a successful call to the accept(),
creat(), creat64(),dup( ), dup2(), fcntl( ), open(), open64(), pipe(), socket(),
or socketpair() function.
buffer Points to a stat structure, into which information is placed about the file. The stat
structure is described in the sys/stat.h header file.
DESCRIPTION
The fstat() function obtains information about the open file associated with the filedes parameter.
The file information is written to the area specified by the buffer parameter, which is a pointer to
a stat structure with this definition from the sys/stat.h header file:
struct stat {
dev_t st_dev;
ino_t st_ino;
mode_t st_mode;
nlink_t st_nlink;
unsigned int st_acl:1; |
unsigned int __filler_1:15; |
uid_t st_uid;
gid_t st_gid;
#if _FILE_OFFSET_BITS != 64 || _TANDEM_ARCH_ == 0 |
mode_t st_basemode; /* Permissions with original group perms */ |
#endif |
dev_t st_rdev;
off_t st_size;
time_t st_atime;
time_t st_mtime;
time_t st_ctime;
#if _FILE_OFFSET_BITS == 64 && _TANDEM_ARCH_ != 0 |
mode_t st_basemode; /* Permissions with original group perms */ |
#endif |
int64_t st_reserved[3];
};
The fstat() function updates any time-related fields associated with the file before writing into
the stat structure, unless it is a read-only fileset. Time-related fields are not updated for read-only
OSS filesets.
The fields in the stat structure have these meanings and content:
3−22 Hewlett-Packard Company 527186-007