Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
stat(2) OSS System Calls Reference Manual
NAME
stat - Provides information about a file
LIBRARY
G-series native Guardian processes: system library
G-series native OSS processes: system library
H-series and J-series native Guardian processes: implicit libraries
H-series and J-series OSS processes: implicit libraries
SYNOPSIS
#include <sys/types.h> /* optional except for POSIX.1 */
#include <sys/stat.h>
int stat(
const char *path,
struct stat *buffer);
PARAMETERS
path Points to the pathname identifying the file.
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 stat() function obtains information about the file whose name is pointed to by the path
parameter. Read, write, or execute permission for the named file is not required, but all direc-
tories listed in the pathname leading to the file must be searchable.
The file information is written to the area specified by the buffer parameter, which is a pointer to
a stat structure. For J06.11 and later J-series RVUs and H06.22 and later H-series RVUs, the
stat structure uses 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:7;
unsigned int st_fileprivs:8; /* File privileges */
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];
};
7−494 Hewlett-Packard Company 527186-023