HP-UX Reference (11i v1 05/09) - 2 System Calls (vol 5)
s
stat(2) stat(2)
HP-UX EXTENSIONS
DESCRIPTION
If the chosen path name or file descriptor refers to a Multi-Level Directory (MLD), and the process does not
have the multilevel effective privilege, the i-node number returned in st_ino is the i-node of the MLD itself.
The parameters for the
stat() function are as follows:
path is a pointer to a path name of any file within the mounted file system.(All directories
listed in the path name must be searchable.)
buf is a pointer to a stat structure, which is where the file status information is stored.
The
stat structure contains the following members:
dev_t st_dev; /* ID of device containing a */
/* directory entry for this file */
ino_t st_ino; /* Inode number */
ushort st_fstype; /* Type of filesystem this file */
/* is in; see sysfs(2) */
ushort st_mode; /* File type, attributes, and */
/* access control summary */
ushort st_basemode /* Permission bits (see chmod(1)) */
ushort st_nlink; /* Number of links */
uid_t st_uid; /* User ID of file owner */
gid_t st_gid; /* Group ID of file group */
dev_t st_rdev; /* Device ID; this entry defined */
/* only for char or blk spec files */
off_t st_size; /* File size (bytes) */
time_t st_atime; /* Time of last access */
time_t st_mtime; /* Last modification time */
time_t st_ctime; /* Last file status change time */
/* Measured in secs since */
/* 00:00:00 GMT, Jan 1, 1970 */
long st_blksize; /* File system block size */
uint st_acl:1; /* Set if the file has optional */
/* access control list entries */
/* HFS File Systems only */
uint st_aclv:1; /* Set if the file has optional */
/* access control list entries */
/* JFS File Systems only */
(Note that the position of items in this list does not necessarily reflect the order of the members in the
structure.)
ERRORS
[EFAULT] buf or path points to an invalid address. The reliable detection of this error is
implementation dependent.
[EOVERFLOW] The file size in bytes or the number of blocks allocated to the file cannot be
represented correctly in the structure pointed to by buf.
NFS
The st_basemode is equal to st_mode and st_acl and the st_aclv fields are zero on files accessed remotely.
The st_acl field is applicable to HFS File Systems only. The st_aclv field is applicable to JFS File Systems
only.
WARNINGS
Access Control Lists - HFS and JFS File Systems only
Access control list descriptions in this entry apply only to HFS and JFS file systems on standard HP-UX
operating systems.
Section 2−−402 Hewlett-Packard Company − 1 − HP-UX 11i Version 1: September 2005