Open System Services System Calls Reference Manual (G06.25+, H06.03+)

fstat(2) OSS System Calls Reference Manual
NAME
fstat - Provides information about an open le
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 ledes,
struct stat *buffer);
PARAMETERS
filedes Species an open le descriptor obtained from a successful call to the accept(),
creat(), dup( ), dup2( ), fcntl( ), open(), pipe( ), socket(),orsocketpair() func-
tion.
buffer Points to a stat structure, into which information is placed about the le. The stat
structure is described in the sys/stat.h header le.
DESCRIPTION
The fstat() function obtains information about the open le associated with the ledes parameter.
The le information is written to the area specied by the buffer parameter, which is a pointer to
a stat structure with ths denition from the sys/stat.h header le:
struct stat {
dev_t st_dev;
ino_t st_ino;
mode_t st_mode;
nlink_t st_nlink;
char ller_1[2];
uid_t st_uid;
gid_t st_gid;
char ller_2[4];
dev_t st_rdev;
off_t st_size;
time_t st_atime;
time_t st_mtime;
time_t st_ctime;
int64_t reserved[3];
};
The fstat() function updates any time-related elds associated with the le before writing into
the stat structure, unless it is a read-only leset. Time-related elds are not updated for read-only
OSS lesets.
The elds in the stat structure have these meanings and content:
st_dev OSS device identier for a leset.
Values for local OSS objects are listed next. Values for local Guardian objects
are described in Use on Guardian Objects, and values for remote Guardian or
OSS objects are described in Use on Remote Objects, later in this reference
page.
314 Hewlett-Packard Company 527186-003